Skip to content

Commit

Permalink
ENH: Add Docker-assisted build, test GHA workflow
Browse files Browse the repository at this point in the history
Add a GHA workflow file to build and test the extension using a Docker
build of 3D Slicer.
  • Loading branch information
jhlegarreta committed Oct 28, 2023
1 parent 2ba47ea commit 8be8698
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build-test-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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
docker image inspect 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 image inspect slicer/slicer-base:latest
docker run \
--rm \
slicer/slicer-build \
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE \
-DSlicer_DIR:PATH=$Slicer_DIR \
-S $EXTENSION_SOURCE_DIR \
-B $EXTENSION_BUILD_DIR && \
cmake \
--build $EXTENSION_BUILD_DIR \
--config $BUILD_TYPE \
- name: Test SlicerDMRI
run: |
docker run \
--rm \
slicer/slicer-build \
ctest -V

0 comments on commit 8be8698

Please sign in to comment.