-
Notifications
You must be signed in to change notification settings - Fork 42
60 lines (54 loc) · 1.8 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Tests
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- 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"
steps:
- uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
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
${{ matrix.sudo }} cmake --build build/ --target install --config ${{ matrix.build_type }}
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=${{ matrix.build_type }} \
-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 ${{ matrix.build_type }}
shell: bash
- name: Run tests
run: ctest -V
working-directory: build
shell: bash