28
28
workflow_dispatch :
29
29
inputs :
30
30
docker-image :
31
- description : ' Which docker image should be used to run this test (build-cached => build from git)'
31
+ description : ' Which docker image should be used to run this test (build-cached => build from git, also pr/<#no> )'
32
32
default : build-cached
33
33
type : string
34
34
freesurfer-build-image :
35
- description : ' FreeSurfer build image to build with (default="": deep MI /fastsurfer-build:freesurferXXX; extract version from Docker/install_fs_pruned.sh)'
35
+ description : ' FreeSurfer build image to build with ("" (default) => deepmi /fastsurfer-build:freesurferXXX; extract version from Docker/install_fs_pruned.sh)'
36
36
type : string
37
37
38
38
permissions : read-all
@@ -117,16 +117,23 @@ jobs:
117
117
# this may also need adaptations in the test script at the bottom
118
118
echo "EXTRA_ARGS=" >> $GITHUB_OUTPUT
119
119
- name : Checkout repository
120
- if : ${{ steps.parse.outputs.CONTINUE == 'true' && steps.parse.outputs.DOCKER_IMAGE == 'build-cached' }}
120
+ if : steps.parse.outputs.CONTINUE == 'true' && steps.parse.outputs.DOCKER_IMAGE == 'build-cached'
121
+ uses : actions/checkout@v4
122
+ - name : Checkout repository
123
+ if : steps.parse.outputs.CONTINUE == 'true' && (steps.parse.outputs.DOCKER_IMAGE == 'build-cached' || startsWith(steps.parse.outputs.DOCKER_IMAGE, 'pr/'))
121
124
uses : actions/checkout@v4
125
+ with :
126
+ ref : ${{ steps.parse.outputs.DOCKER_IMAGE }}
122
127
- name : Get the FreeSurfer version
123
- if : ${{ steps.parse.outputs.CONTINUE == 'true' && steps.parse.outputs.DOCKER_IMAGE == 'build-cached' }}
128
+ if : steps.parse.outputs.CONTINUE == 'true' && ( steps.parse.outputs.DOCKER_IMAGE == 'build-cached' || startsWith(steps.parse.outputs.DOCKER_IMAGE, 'pr/'))
124
129
shell : bash
125
130
id : parse-version
126
131
run : |
127
132
# get the FreeSurfer version from install_fs_pruned.sh
128
133
{
129
- eval "$(grep "^fslink=" ./Docker/install_fs_pruned.sh)"
134
+ fslink="$(grep "^fslink=" ./Docker/install_fs_pruned.sh)"
135
+ fslink="${fslink:7}"
136
+ if [[ "${fslink:0:1}" == '"' ]] || [[ "${fslink:0:1}" == "'" ]] ; then fslink="${fslink:1:-1}" ; fi
130
137
fs_version="$(basename "$(dirname "$fslink")")"
131
138
fs_version_short="${fs_version//\./}"
132
139
echo "FS_VERSION=$fs_version"
@@ -146,8 +153,8 @@ jobs:
146
153
# currently, this image has to be updated and used to circumvent storage limitations in github actions
147
154
# and it is also faster to use this prebuilt, reduced-size freesurfer distribution
148
155
freesurfer-build-image : " ${{ steps.parse-version.outputs.FS_BUILD_IMAGE }}"
149
- fastsurfer :
150
- name : ' Run FastSurfer on sample images'
156
+ fastsurfer-test :
157
+ name : ' Run FastSurfer on sample images and perform tests '
151
158
needs : build-docker
152
159
runs-on : ubuntu-latest
153
160
timeout-minutes : 180
@@ -161,43 +168,48 @@ jobs:
161
168
- subject-id : 1.0mm
162
169
file-extension : " .mgz"
163
170
image-key : QUICKTEST_IMAGE_HREF_1mm
171
+ case-key : QUICKTEST_TARGET_HREF_1mm
164
172
- subject-id : 0.8mm
165
173
file-extension : " .nii.gz"
166
174
image-key : QUICKTEST_IMAGE_HREF_08mm
175
+ case-key : QUICKTEST_TARGET_HREF_08mm
167
176
steps :
168
- - uses : actions/checkout@v4
169
- with :
170
- sparse-checkout : .github/actions
177
+ - name : Check out the repository that is to be tested
178
+ uses : actions/checkout@v4
171
179
- name : Run FastSurfer for ${{ matrix.subject-id }} with the previously created docker container
172
- uses : Deep-MI/FastSurfer/.github/actions/run-fastsurfer@dev
180
+ # uses: Deep-MI/FastSurfer/.github/actions/run-fastsurfer@dev
181
+ uses : ./.github/actions/run-fastsurfer@dev
173
182
with :
174
183
subject-id : ${{ matrix.subject-id }}
175
184
file-extension : ${{ matrix.file-extension }}
176
185
image-href : ${{ secrets[matrix.image-key] }}
177
186
license : ${{ secrets.QUICKTEST_LICENSE }}
178
187
docker-image : ${{ needs.build-docker.outputs.docker-image }}
179
188
extra-args : ${{ needs.build-docker.outputs.extra-args }}
180
- tests :
181
- name : ' Download data and perform tests'
182
- needs : fastsurfer
183
- runs-on : ubuntu-latest
184
- timeout-minutes : 60
185
- strategy :
186
- # the following matrix strategy will result in one run per subject as matrix is "one-dimensional".
187
- # Additional parameters under "include" are then added as additional (dependent) information
188
- matrix :
189
- subject-id : [0.8mm, 1.0mm]
190
- include :
191
- - subject-id : 0.8mm
192
- case-key : QUICKTEST_TARGET_HREF_08mm
193
- - subject-id : 1.0mm
194
- case-key : QUICKTEST_TARGET_HREF_1mm
195
- steps :
196
- - uses : actions/checkout@v4
189
+ cleanup : ' true'
197
190
- name : Run tests
198
- uses : Deep-MI/FastSurfer/.github/actions/run-tests@dev
191
+ # uses: Deep-MI/FastSurfer/.github/actions/run-tests@dev
192
+ uses : ./.github/actions/run-tests
199
193
with :
200
194
subject-id : ${{ matrix.subject-id }}
201
195
subjects-dir : ${{ env.SUBJECTS_DIR }}
202
196
reference-dir : ${{ env.REFERENCE_DIR }}
203
197
case-href : ${{ secrets[matrix.case-key] }}
198
+ junit-file : /tmp/fastsurfer-quicktest-${{ matrix.subject-id }}.junit.xml
199
+ annotation :
200
+ name : Annotate test results as checks
201
+ runs-on : ubuntu-latest
202
+ needs : [fastsurfer-test, build-docker]
203
+ if : always() && needs.build-docker.outputs.continue == 'true'
204
+ steps :
205
+ - name : Retrieve test JUnit files
206
+ uses : actions/download-artifact@v4
207
+ with :
208
+ pattern : fastsurfer-${{ github.sha }}-junit-*
209
+ merge-multiple : ' true'
210
+ path : /tmp
211
+ - name : Write the results into the check
212
+ uses : mikepenz/action-junit-report@v5
213
+ with :
214
+ report_paths : /tmp/fastsurfer-quicktest-*.junit.xml
215
+ check_name : Annotate the test results as checks
0 commit comments