From 4501fda6d74b682feade62b05456ebc979289951 Mon Sep 17 00:00:00 2001 From: EmilDohne <86836589+EmilDohne@users.noreply.github.com> Date: Sat, 24 Feb 2024 17:45:43 +0100 Subject: [PATCH] update builds to run on a matrix instead --- .../{cmake-build-windows.yml => cmake-build.yml} | 12 ++++++++---- .../{cmake-test-windows.yml => cmake-test.yml} | 14 +++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) rename .github/workflows/{cmake-build-windows.yml => cmake-build.yml} (85%) rename .github/workflows/{cmake-test-windows.yml => cmake-test.yml} (86%) diff --git a/.github/workflows/cmake-build-windows.yml b/.github/workflows/cmake-build.yml similarity index 85% rename from .github/workflows/cmake-build-windows.yml rename to .github/workflows/cmake-build.yml index b412dc0c..46ba9b00 100644 --- a/.github/workflows/cmake-build-windows.yml +++ b/.github/workflows/cmake-build.yml @@ -1,6 +1,6 @@ # This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml -name: CI Windows +name: Build on: workflow_dispatch: @@ -8,6 +8,7 @@ on: push: branches: - master + - feat-add-cross-compilation release: types: - published @@ -21,20 +22,23 @@ jobs: # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: windows-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 with: submodules: 'recursive' - - name: Configure CMake + - name: Configure CMake ${{ matrix.os }} # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: | cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPSAPI_BUILD_DOCS=OFF -DPSAPI_BUILD_BENCHMARKS=OFF -DPSAPI_BUILD_TESTS=OFF - - name: Build + - name: Build ${{ matrix.os }} # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} diff --git a/.github/workflows/cmake-test-windows.yml b/.github/workflows/cmake-test.yml similarity index 86% rename from .github/workflows/cmake-test-windows.yml rename to .github/workflows/cmake-test.yml index a9dda4a5..4b8c0614 100644 --- a/.github/workflows/cmake-test-windows.yml +++ b/.github/workflows/cmake-test.yml @@ -1,6 +1,6 @@ # This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml -name: Test Windows +name: Test on: workflow_dispatch: @@ -8,6 +8,7 @@ on: push: branches: - master + - feat-add-cross-compilation release: types: - published @@ -21,25 +22,28 @@ jobs: # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: windows-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 with: submodules: 'recursive' - - name: Configure CMake + - name: Configure CMake ${{ matrix.os }} # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: | cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPSAPI_BUILD_DOCS=OFF -DPSAPI_BUILD_BENCHMARKS=OFF -DPSAPI_BUILD_EXAMPLES=OFF - - name: Build + - name: Build ${{ matrix.os }} # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - name: Test + - name: Test ${{ matrix.os }} working-directory: ${{github.workspace}}/build/PhotoshopTest # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail