Skip to content

Commit

Permalink
85 need to update cmake files and cd environment (#87)
Browse files Browse the repository at this point in the history
* Issue #85: removal of mention of cdash has server is not available anymore

* Issue #85: Adding a .ignore file

* Issue #86 (#85): removed matlab dependent tests. Added a new one with Catch2 as a dependency

* Issue #85 removing gitlab ci yaml file

* Issue #85: Adding initial github action yaml file

* Issue #85: Adding Catch2

* Issue #85: Adding macos and win
  • Loading branch information
mmodat authored Jul 28, 2022
1 parent 309576a commit 1067a1c
Show file tree
Hide file tree
Showing 79 changed files with 309 additions and 17,960 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: build-and-test
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
include:
- os: ubuntu-20.04
c-compiler: "gcc"
cxx-compiler: "g++"
use_cuda: "OFF"
use_opencl: "OFF"
use_openmp: "ON"
- os: macos-11
c-compiler: "gcc"
cxx-compiler: "g++"
use_cuda: "OFF"
use_opencl: "OFF"
use_openmp: "OFF"
- 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
if: matrix.os != 'windows-2022'
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: Install Catch2 (windows)
if: matrix.os == 'windows-2022'
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
if: matrix.os != 'windows-2022'
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: Configure NiftyReg (windows)
if: matrix.os == 'windows-2022'
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
if: matrix.os != 'windows-2022'
run: cmake --build build --config Release
shell: bash

- name: Build NiftyReg (windows)
if: matrix.os == 'windows-2022'
run: |
call "${{ matrix.vcvars64 }}"
cmake --build build --config Release
shell: cmd

- name: Run tests
if: matrix.os != 'windows-2022'
run: ctest -V
working-directory: build
shell: bash

- name: Run tests (windows)
if: matrix.os == 'windows-2022'
run: |
call "${{ matrix.vcvars64 }}"
ctest -V
working-directory: build
shell: cmd

41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# IDE
.idea

# Mac trash folder
.DS_Store

# Build
build
Loading

0 comments on commit 1067a1c

Please sign in to comment.