-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add Docker-assisted build, test GHA workflow
Add a GHA workflow file to build and test the extension using a Docker build of 3D Slicer.
- Loading branch information
1 parent
2ba47ea
commit b030e77
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Build, test using docker | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "**.md" | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-22.04 | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
||
steps: | ||
|
||
- name: Checkout out SlicerDMRI | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{ github.workspace }}/SlicerDMRI | ||
|
||
- name: Get specific version of CMake, Ninja | ||
uses: lukka/get-cmake@v3.24.2 | ||
|
||
- name: Pull Slicer from Docker | ||
run: | ||
docker pull slicer/slicer-base:latest | ||
|
||
- name: Build SlicerDMRI | ||
run: | | ||
Slicer_DIR=/usr/src/Slicer-build/Slicer-build | ||
EXTENSION_NAME=SlicerDMRI | ||
EXTENSION_SOURCE_DIR=${{ github.workspace }}/$EXTENSION_NAME | ||
EXTENSION_BUILD_DIR=${{ github.workspace }}/$EXTENSION_NAME-build | ||
docker run \ | ||
--rm \ | ||
-v $EXTENSION_SOURCE_DIR:/usr/src/slicerdmri \ | ||
-v $EXTENSION_BUILD_DIR:/usr/src/slicerdmri-build \ | ||
-v $EXTENSION_BUILD_DIR:/usr/src/slicerdmri-build \ | ||
slicer/slicer-base \ | ||
cmake \ | ||
-GNinja \ | ||
-DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE \ | ||
-DSlicer_DIR:PATH=$Slicer_DIR \ | ||
-S /usr/src/slicerdmri \ | ||
-B /usr/src/slicerdmri-build | ||
docker run \ | ||
--rm \ | ||
-v $EXTENSION_BUILD_DIR:/usr/src/slicerdmri-build \ | ||
slicer/slicer-base \ | ||
cmake \ | ||
--build /usr/src/slicerdmri-build \ | ||
--config $BUILD_TYPE \ | ||
- name: Test SlicerDMRI | ||
run: | | ||
docker run \ | ||
--rm \ | ||
slicer/slicer-base \ | ||
ctest -V /usr/src/slicerdmri-build |