diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2572489ab3..b1c02143f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: - main jobs: clang-format-check: - runs-on: macos-12 + runs-on: macos-13 steps: - name: Clone repository uses: actions/checkout@v4 @@ -22,111 +22,79 @@ jobs: - name: Run clang format check run: | bash scripts/check-clang.sh - mac-os-build-clang: - runs-on: macos-12 - env: - CC: /usr/bin/clang - CXX: /usr/bin/clang++ - AWS_KVS_LOG_LEVEL: 2 - permissions: - id-token: write - contents: read - steps: - - name: Clone repository - uses: actions/checkout@v4 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - 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 -DCOMPILER_WARNINGS=TRUE - make - - name: Run tests - run: | - cd build - ./tst/webrtc_client_test - mac-os-build-gcc: - runs-on: macos-12 - env: - CC: gcc - CXX: g++ - AWS_KVS_LOG_LEVEL: 2 - permissions: - id-token: write - contents: read - steps: - - name: Clone repository - uses: actions/checkout@v4 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - 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 -DCOMPILER_WARNINGS=TRUE - make - - name: Run tests - run: | - cd build - ./tst/webrtc_client_test - mac-os-m1-build-clang: - runs-on: macos-13-xlarge + mac-tests: + strategy: + matrix: + os: + - name: Mac Intel + runner: macos-13 + - name: Mac Apple Silicon + runner: macos-15 + compiler: [ gcc, clang ] + config: + - name: Shared OpenSSL + cmake_flags: "-DBUILD_TEST=ON" + - name: Static OpenSSL + cmake_flags: "-DBUILD_TEST=ON -DBUILD_STATIC_LIBS=TRUE" + - name: Shared MbedTLS + cmake_flags: "-DBUILD_TEST=ON -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON" + - name: Static MbedTLS + cmake_flags: "-DBUILD_TEST=ON -DBUILD_STATIC_LIBS=TRUE -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON" + fail-fast: false + env: AWS_KVS_LOG_LEVEL: 2 - PKG_CONFIG_PATH: /usr/local/opt/pkgconfig permissions: id-token: write contents: read + + runs-on: ${{ matrix.os.runner }} + name: ${{ matrix.os.name }}, ${{ matrix.compiler }}, ${{ matrix.config.name }} + steps: - - name: Clone repository + - name: Checkout repository uses: actions/checkout@v4 + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} - - name: Install dependencies - run: | - brew install gstreamer glib - - name: Build repository + + - name: Install GStreamer run: | - brew unlink openssl - mkdir build && cd build - sh -c 'cmake .. -DBUILD_TEST=TRUE -DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++' - make - - name: Run tests + brew install gstreamer + + - name: Configure and build ${{ matrix.config.name }} run: | + if [[ "${{ matrix.compiler }}" == "gcc" ]]; then + export CC="gcc-14" + export CXX="g++-14" + else + export CC="clang" + export CXX="clang++" + fi + echo "Using $CC and $CXX" + + mkdir -p build cd build - ./tst/webrtc_client_test - static-build-mac: - runs-on: macos-12 - env: - AWS_KVS_LOG_LEVEL: 2 - permissions: - id-token: write - contents: read - steps: - - name: Clone repository - uses: actions/checkout@v4 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_STATIC_LIBS=TRUE -DBUILD_TEST=TRUE - make + + if [[ "${{ matrix.compiler }}" == "gcc" ]]; then + # Skip building the tests for Mac with GCC + # https://github.com/awslabs/aws-crt-cpp/issues/605 + cmake .. ${{ matrix.config.cmake_flags }} -DENABLE_AWS_SDK_IN_TESTS=OFF + else + cmake .. ${{ matrix.config.cmake_flags }} + fi + make -j$(sysctl -n hw.ncpu) + shell: bash + - name: Run tests run: | cd build ./tst/webrtc_client_test + shell: bash + address-sanitizer: runs-on: ubuntu-20.04 env: