Skip to content

Commit

Permalink
Use self-hosted runners to enable CUDA for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
onurulgen committed Feb 8, 2024
1 parent 2c3432c commit 2931554
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ name: Coverage
on: [push, pull_request]
jobs:
Coverage:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux, gpu]
steps:
- name: Clone NiftyReg
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake git lcov

- name: Install Catch2
run: |
Expand All @@ -14,18 +16,15 @@ jobs:
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install --config Debug
- name: Install lcov
run: sudo apt-get install lcov

- name: Configure NiftyReg
run: |
mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
cmake -DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_ALL_DEP=ON \
-DUSE_CUDA=OFF \
-DUSE_CUDA=ON \
-DUSE_OPENCL=OFF \
-DUSE_SSE=OFF \
-DUSE_OPENMP=OFF \
Expand All @@ -37,12 +36,12 @@ jobs:
run: cmake --build build --config Debug

- name: Run tests
run: ctest -V
working-directory: build
run: ctest -V

- name: Coverage
run: make coverage
working-directory: build
run: make coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
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
Expand All @@ -27,34 +24,34 @@ jobs:
if: matrix.os == 'windows-latest'

- name: Install Catch2
shell: bash
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
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} \
-DCMAKE_C_COMPILER=${{ matrix.c-compiler }} \
cmake -DCMAKE_C_COMPILER=${{ matrix.c-compiler }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_ALL_DEP=ON \
-DUSE_CUDA=${{ matrix.use_cuda }} \
-DUSE_OPENCL=${{ matrix.use_opencl }} \
-DUSE_CUDA=OFF \
-DUSE_OPENCL=OFF \
-DUSE_SSE=ON \
-DUSE_OPENMP=${{ matrix.use_openmp }} \
-DUSE_OPENMP=ON \
-DBUILD_TESTING=ON \
..
shell: bash
- name: Build NiftyReg
run: cmake --build build --config ${{ matrix.build_type }}
shell: bash
run: cmake --build build --config ${{ matrix.build_type }}

- name: Run tests
run: ctest -V
shell: bash
working-directory: build
shell: bash
run: ctest -V
2 changes: 1 addition & 1 deletion niftyreg_build_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
401
402

0 comments on commit 2931554

Please sign in to comment.