From 2f7ca4edf0ad289db9828b8ab78883a81978014a Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 12 Jun 2024 15:13:15 +0200 Subject: [PATCH] ci: update macos workflows --- .github/workflows/amd64_macos.yml | 56 ++++++++++++++++++------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/.github/workflows/amd64_macos.yml b/.github/workflows/amd64_macos.yml index 6d5e4d0..df89c55 100644 --- a/.github/workflows/amd64_macos.yml +++ b/.github/workflows/amd64_macos.yml @@ -1,35 +1,26 @@ +# ref: https://github.com/actions/runner-images name: amd64 macOS on: [push, pull_request, workflow_dispatch] +# Building using the github runner environement directly. jobs: - # Building using the github runner environement directly. - macos: - runs-on: macos-latest + native: strategy: matrix: - build: [ - ["Xcode", "Release", "ALL_BUILD", "RUN_TESTS", "install"], - ["Unix Makefiles", "Release", "all", "test", "install"] + cmake: [ + {generator: "Xcode", config: Release, build_target: ALL_BUILD, test_target: RUN_TESTS, install_target: install}, + {generator: "Unix Makefiles", config: Release, build_target: all, test_target: test, install_target: install}, ] fail-fast: false - env: - GENERATOR: ${{ matrix.build[0] }} - BUILD_TYPE: ${{ matrix.build[1] }} - BUILD_TARGET: ${{ matrix.build[2] }} - TEST_TARGET: ${{ matrix.build[3] }} - INSTALL_TARGET: ${{ matrix.build[4] }} + name: MacOS • ${{ matrix.cmake.generator }} + runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: Swig install - run: brew install swig - - name: Check swig - run: swig -version - # Install .NET SDKs - - name: Setup .NET Core 3.1 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x + run: | + brew install swig + swig -version - name: Setup .NET 6.0 uses: actions/setup-dotnet@v1 with: @@ -39,10 +30,27 @@ jobs: - name: Check cmake run: cmake --version - name: Configure - run: cmake -S. -Bbuild -G "$GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=install + run: > + cmake -S. -Bbuild + -G "${{ matrix.cmake.generator }}" + -DCMAKE_BUILD_TYPE=${{ matrix.cmake.config }} + -DCMAKE_INSTALL_PREFIX=install - name: Build - run: cmake --build build --config "$BUILD_TYPE" --target "$BUILD_TARGET" -v + run: > + cmake --build build + --config ${{ matrix.cmake.config }} + --target ${{ matrix.cmake.build_target }} + -v -j2 - name: Test - run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --config "$BUILD_TYPE" --target "$TEST_TARGET" -v + run: > + CTEST_OUTPUT_ON_FAILURE=1 + cmake --build build + --config ${{ matrix.cmake.config }} + --target ${{ matrix.cmake.test_target }} + -v - name: Install - run: cmake --build build --config "$BUILD_TYPE" --target "$INSTALL_TARGET" -v + run: > + cmake --build build + --config ${{ matrix.cmake.config }} + --target ${{ matrix.cmake.install_target }} + -v