From d22da3ad1c78325a590484280dad617c5bd9f0ae Mon Sep 17 00:00:00 2001 From: Pierre Dejoue Date: Mon, 14 Aug 2023 14:02:56 +0200 Subject: [PATCH] CI: add config macos-arm64 to the automatic build --- .github/workflows/build.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41e88ca..f39c373 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,36 +6,46 @@ on: pull_request: branches: [ "main" ] -env: - BUILD_TYPE: Debug - jobs: build: strategy: fail-fast: true matrix: os: [ ubuntu, macos, windows ] + build_type: [ Debug ] + arch: [ x86_64, arm64 ] + exclude: + - os: ubuntu + arch: arm64 + - os: windows + arch: arm64 runs-on: ${{ matrix.os }}-latest + env: + CMAKE_CONFIG_EXTRA: ${{ matrix.os == 'macos' && format('-DCMAKE_OSX_ARCHITECTURES={0}', matrix.arch) || '' }} + steps: - uses: actions/checkout@v3 - name: Configure CMake - run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DPICROSS_BUILD_CLI=ON -DPICROSS_BUILD_TESTS=ON + run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DPICROSS_BUILD_CLI=ON -DPICROSS_BUILD_TESTS=ON ${{ env.CMAKE_CONFIG_EXTRA }} - name: Build working-directory: ${{ github.workspace }}/build - run: cmake --build . --config ${{ env.BUILD_TYPE }} + run: cmake --build . --config ${{ matrix.build_type }} - - name: Version + - if: matrix.arch == 'x86_64' + name: Version working-directory: ${{ github.workspace }}/build - run: cmake --build . --target picross_cli_version --config ${{ env.BUILD_TYPE }} + run: cmake --build . --target picross_cli_version --config ${{ matrix.build_type }} - - name: Test stdutils + - if: matrix.arch == 'x86_64' + name: Test stdutils working-directory: ${{ github.workspace }}/build - run: cmake --build . --target run_utests_stdutils --config ${{ env.BUILD_TYPE }} + run: cmake --build . --target run_utests_stdutils --config ${{ matrix.build_type }} - - name: Test picross + - if: matrix.arch == 'x86_64' + name: Test picross working-directory: ${{ github.workspace }}/build - run: cmake --build . --target run_utests_picross --config ${{ env.BUILD_TYPE }} + run: cmake --build . --target run_utests_picross --config ${{ matrix.build_type }}