Skip to content

Commit

Permalink
additional builds with cmake flags for mac and ubuntu, max string siz…
Browse files Browse the repository at this point in the history
…e for dc, no strlen calc in max string sizes
  • Loading branch information
niyatim23 committed Nov 17, 2023
1 parent fe1782f commit da23a05
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 4 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,34 @@ jobs:
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE
make
- name: Run tests
run: |
cd build
./tst/webrtc_client_test
mac-os-dc-metrics-build-clang:
runs-on: macos-11
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
AWS_KVS_LOG_LEVEL: 2
LDFLAGS: -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
CPATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
permissions:
id-token: write
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Build repository
run: |
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DENABLE_SENDING_METRICS_TO_VIEWER=ON -DCOMPILER_WARNINGS=TRUE
make
- name: Run tests
run: |
cd build
Expand Down Expand Up @@ -466,6 +494,32 @@ jobs:
run: |
cd build
timeout --signal=SIGABRT 60m ./tst/webrtc_client_test
ubuntu-os-dc-metrics-build:
runs-on: ubuntu-20.04
env:
AWS_KVS_LOG_LEVEL: 2
permissions:
id-token: write
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Build repository
run: |
# TODO: Remove the following line. This is only a workaround for enabling IPv6, https://github.com/travis-ci/travis-ci/issues/8891.
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DENABLE_SENDING_METRICS_TO_VIEWER=ON
make
- name: Run tests
run: |
cd build
timeout --signal=SIGABRT 60m ./tst/webrtc_client_test
windows-msvc-openssl:
runs-on: windows-2022
env:
Expand Down
2 changes: 1 addition & 1 deletion samples/Common.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ VOID onDataChannelMessage(UINT64 customData, PRtcDataChannel pDataChannel, BOOL
PSampleStreamingSession pSampleStreamingSession = (PSampleStreamingSession) customData;
PSampleConfiguration pSampleConfiguration = pSampleStreamingSession->pSampleConfiguration;
DataChannelMessage dataChannelMessage = {'\0', '\0', '\0', '\0', '\0', '\0'};
CHAR pMessageSend[SIZEOF(DataChannelMessage)];
CHAR pMessageSend[MAX_DATA_CHANNEL_METRICS_MESSAGE_SIZE];
jsmn_parser parser;
jsmn_init(&parser);
jsmntok_t tokens[MAX_JSON_TOKEN_COUNT];
Expand Down
7 changes: 4 additions & 3 deletions samples/Samples.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ extern "C" {
"\"connectStartTime\": %llu, \"connectEndTime\": %llu }"
#define ICE_AGENT_METRICS_JSON_TEMPLATE "{\"candidateGatheringStartTime\": %llu, \"candidateGatheringEndTime\": %llu }"

#define MAX_PEER_CONNECTION_METRICS_MESSAGE_SIZE STRLEN(PEER_CONNECTION_METRICS_JSON_TEMPLATE) + 20 * 2
#define MAX_SIGNALING_CLIENT_METRICS_MESSAGE_SIZE STRLEN(SIGNALING_CLIENT_METRICS_JSON_TEMPLATE) + 20 * 10
#define MAX_ICE_AGENT_METRICS_MESSAGE_SIZE STRLEN(ICE_AGENT_METRICS_JSON_TEMPLATE) + 20 * 2
#define MAX_DATA_CHANNEL_METRICS_MESSAGE_SIZE 172 // strlen(DATA_CHANNEL_MESSAGE_TEMPLATE) + 20 * 5
#define MAX_PEER_CONNECTION_METRICS_MESSAGE_SIZE 105 // strlen(PEER_CONNECTION_METRICS_JSON_TEMPLATE) + 20 * 2
#define MAX_SIGNALING_CLIENT_METRICS_MESSAGE_SIZE 302 // strlen(SIGNALING_CLIENT_METRICS_JSON_TEMPLATE) + 20 * 10
#define MAX_ICE_AGENT_METRICS_MESSAGE_SIZE 113 // strlen(ICE_AGENT_METRICS_JSON_TEMPLATE) + 20 * 2

CHAR pPeerConnectionMetricsMessage[MAX_PEER_CONNECTION_METRICS_MESSAGE_SIZE];
CHAR pSignalingClientMetricsMessage[MAX_SIGNALING_CLIENT_METRICS_MESSAGE_SIZE];
Expand Down

0 comments on commit da23a05

Please sign in to comment.