From 728192c2dcce149c0095ca9a81dd05f89bb03f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=9Clgen?= Date: Wed, 29 Nov 2023 16:45:35 +0000 Subject: [PATCH] Combine GitHub Actions workflows for testing into a single file --- .github/workflows/macos.yml | 55 --------------------- .github/workflows/{linux.yml => tests.yml} | 25 ++++++---- .github/workflows/windows.yml | 56 ---------------------- niftyreg_build_version.txt | 2 +- 4 files changed, 16 insertions(+), 122 deletions(-) delete mode 100644 .github/workflows/macos.yml rename .github/workflows/{linux.yml => tests.yml} (63%) delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 80b3ad99..00000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: macos -on: [push, pull_request] -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 1 - matrix: - os: [macos-11] - include: - - os: macos-11 - c-compiler: "gcc" - cxx-compiler: "g++" - use_cuda: "OFF" - use_opencl: "OFF" - use_openmp: "OFF" - - steps: - - uses: actions/checkout@v3 - - - name: Get CMake - uses: lukka/get-cmake@latest - - - name: Install Catch2 - run: | - git clone https://github.com/catchorg/Catch2.git - cd Catch2 - cmake -Bbuild -H. -DBUILD_TESTING=OFF - sudo cmake --build build/ --target install --config Release - shell: bash - - - name: Configure NiftyReg - run: | - mkdir build - cd build - cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} \ - -DCMAKE_C_COMPILER=${{ matrix.c-compiler }} \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_ALL_DEP=ON \ - -DUSE_CUDA=${{ matrix.use_cuda }} \ - -DUSE_OPENCL=${{ matrix.use_opencl }} \ - -DUSE_SSE=ON \ - -DUSE_OPENMP=${{ matrix.use_openmp }} \ - -DBUILD_TESTING=ON \ - .. - shell: bash - - - name: Build NiftyReg - run: cmake --build build --config Release - shell: bash - - - name: Run tests - run: ctest -V - working-directory: build - shell: bash \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/tests.yml similarity index 63% rename from .github/workflows/linux.yml rename to .github/workflows/tests.yml index 6b9c1f84..af68a461 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/tests.yml @@ -1,16 +1,20 @@ -name: linux +name: tests on: [push, pull_request] jobs: build: runs-on: ${{ matrix.os }} - strategy: - max-parallel: 1 + strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-latest, macos-latest, windows-latest] include: - - os: ubuntu-20.04 + - sudo: "sudo" # For ubuntu and macos c-compiler: "gcc" cxx-compiler: "g++" + - os: windows-latest # For windows only + sudo: "" + c-compiler: "cl.exe" + cxx-compiler: "cl.exe" + - build_type: "Debug" # For all platforms use_cuda: "OFF" use_opencl: "OFF" use_openmp: "ON" @@ -18,15 +22,16 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Get CMake - uses: lukka/get-cmake@latest + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.3 + if: matrix.os == 'windows-latest' - name: Install Catch2 run: | git clone https://github.com/catchorg/Catch2.git cd Catch2 cmake -Bbuild -H. -DBUILD_TESTING=OFF - sudo cmake --build build/ --target install --config Release + ${{ matrix.sudo }} cmake --build build/ --target install --config ${{ matrix.build_type }} shell: bash - name: Configure NiftyReg @@ -35,7 +40,7 @@ jobs: cd build cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} \ -DCMAKE_C_COMPILER=${{ matrix.c-compiler }} \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DBUILD_ALL_DEP=ON \ -DUSE_CUDA=${{ matrix.use_cuda }} \ -DUSE_OPENCL=${{ matrix.use_opencl }} \ @@ -46,7 +51,7 @@ jobs: shell: bash - name: Build NiftyReg - run: cmake --build build --config Release + run: cmake --build build --config ${{ matrix.build_type }} shell: bash - name: Run tests diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index d2079515..00000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: windows -on: [push, pull_request] -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 1 - matrix: - os: [windows-2022] - include: - - os: windows-2022 - c-compiler: "cl.exe" - cxx-compiler: "cl.exe" - use_cuda: "OFF" - use_opencl: "OFF" - use_openmp: "ON" - vcvars64: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" - steps: - - uses: actions/checkout@v3 - - - name: Get CMake - uses: lukka/get-cmake@latest - - - name: Install Catch2 - run: | - call "${{ matrix.vcvars64 }}" - git clone https://github.com/catchorg/Catch2.git - cd Catch2 - cmake -Bbuild -H. -DBUILD_TESTING=OFF - cmake --build build/ --target install --config Release - shell: cmd - - - - name: Configure NiftyReg - run: | - mkdir build - cd build - call "${{ matrix.vcvars64 }}" - cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} -DCMAKE_C_COMPILER=${{ matrix.c-compiler }} -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL_DEP=ON -DUSE_CUDA=${{ matrix.use_cuda }} -DUSE_OPENCL=${{ matrix.use_opencl }} -DUSE_SSE=ON -DUSE_OPENMP=${{ matrix.use_openmp }} -DBUILD_TESTING=ON .. - shell: cmd - - - - name: Build NiftyReg - run: | - call "${{ matrix.vcvars64 }}" - cmake --build build --config Release - shell: cmd - - - - name: Run tests - run: | - call "${{ matrix.vcvars64 }}" - ctest -V - working-directory: build - shell: cmd - diff --git a/niftyreg_build_version.txt b/niftyreg_build_version.txt index a5c3fde3..38a45c3e 100644 --- a/niftyreg_build_version.txt +++ b/niftyreg_build_version.txt @@ -1 +1 @@ -373 +374