Skip to content

CUDA Test 1

CUDA Test 1 #5

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
include:
- os: ubuntu-20.04 # For Ubuntu only
os-name: "Ubuntu"
- os: macos-latest # For macOS only
os-name: "macOS"
- sudo: "sudo" # For Ubuntu and macOS
c-compiler: "gcc"
cxx-compiler: "g++"
- os: windows-latest # For Windows only
os-name: "Windows"
sudo: ""
c-compiler: "cl.exe"
cxx-compiler: "cl.exe"
- build_type: "Release" # For all platforms
steps:
- uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
if: matrix.os-name == 'Windows'
- name: Install CUDA Toolkit
uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '12.3.2'
- name: Configure NiftyReg
shell: bash
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=ON \
-DUSE_OPENCL=OFF \
-DUSE_SSE=ON \
-DUSE_OPENMP=ON \
-DBUILD_TESTING=OFF \
..
- name: Build NiftyReg
shell: bash
run: cmake --build build --config ${{ matrix.build_type }}
- name: Prepare the package
if: matrix.os-name == 'Windows'
shell: powershell
working-directory: build/reg-apps/Release
run: |
Compress-Archive -Path *.exe -DestinationPath ../../NiftyReg.zip
- name: Prepare the package
if: matrix.os-name == 'Ubuntu'
working-directory: build/reg-apps
run: |
find . -maxdepth 1 -type f -executable -exec zip ../NiftyReg.zip {} \;
- name: Prepare the package
if: matrix.os-name == 'macOS'
working-directory: build/reg-apps
run: |
find . -maxdepth 1 -type f -perm +111 -exec zip ../NiftyReg.zip {} \;
- name: Get the tag name
id: get_tag
shell: bash
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Upload the package
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: build/NiftyReg.zip
asset_name: NiftyReg-${{ matrix.os-name }}-${{ steps.get_tag.outputs.tag }}.zip