Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to macos-13 and 15, use DRY for Mac jobs #2090

Merged
merged 7 commits into from
Dec 5, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 58 additions & 88 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,111 +22,81 @@ 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: ""
- name: Static OpenSSL
cmake_flags: "-DBUILD_STATIC_LIBS=TRUE"
- name: Shared MbedTLS
cmake_flags: "-DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON"
- name: Static MbedTLS
cmake_flags: "-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
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

- 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 }}
else
cmake .. ${{ matrix.config.cmake_flags }} -DBUILD_TEST=TRUE
fi
make -j$(sysctl -n hw.ncpu)
shell: bash

- name: Run tests
run: |
if [[ "${{ matrix.compiler }}" == "gcc" ]]; then
# Skip running the tests for Mac with GCC
# https://github.com/awslabs/aws-crt-cpp/issues/605
exit 0
fi

cd build
./tst/webrtc_client_test
shell: bash

address-sanitizer:
runs-on: ubuntu-20.04
env:
Expand Down
Loading