-
Notifications
You must be signed in to change notification settings - Fork 6
119 lines (105 loc) · 4.21 KB
/
sea-test-and-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Test Sea and publish dockerfiles
on:
push:
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: "false"
env:
REGISTRY: ghcr.io
jobs:
run-tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
os-name: [xenial, bionic, focal, centos7, fedora32, fedora33, fedora34]
name: Test in ${{ matrix.os-name }}
steps:
- run: docker --version
- name: Git checkout
uses: actions/checkout@v2
- run: cd ${{ github.workspace }}
- run: docker build . -f containers/base/Dockerfile.${{ matrix.os-name }} -t imagetest:${{ matrix.os-name }}
- run: docker run --rm -v $PWD:$PWD -w $PWD imagetest:${{ matrix.os-name }} make test debug_opts="-g -ggdb --coverage -fprofile-arcs -ftest-coverage"
- run: docker run --rm -v $PWD:$PWD -w $PWD imagetest:${{ matrix.os-name }} bats tests/tests.bats tests/test_flusher.bats tests/test_prefetch.bats
- run: docker run --rm -v $PWD:$PWD -w $PWD imagetest:${{ matrix.os-name }} bash -c "MOUNT=$PWD/mount SOURCE=$PWD/source SOURCE_1=$PWD/source_1 levels=1 bash tests/setup.bash"
- run: docker run --rm -v $PWD:$PWD -w $PWD -e SEA_HOME=$PWD -e LD_PRELOAD=$PWD/build/sea.so imagetest:${{ matrix.os-name }} tests/test_custom
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
gcov_executable: docker run --rm -v $PWD:$PWD -w $PWD imagetest:${{ matrix.os-name }} gcov -abcfu build
- name: setup tmate session
if: ${{ failure() && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
uses: mxschmitt/action-tmate@v3
build-and-push-base-image:
if: github.event_name != 'pull_request'
needs: run-tests
runs-on: ubuntu-latest
strategy:
matrix:
os-name: [ xenial, bionic, focal, centos7, fedora32, fedora33, fedora34 ]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker - Base images
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/sea-${{ matrix.os-name }}
- name: Build and push Docker image - Base images
uses: docker/build-push-action@v2
with:
context: .
file: containers/base/Dockerfile.${{ matrix.os-name }}
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-and-push-application-image:
if: github.event_name != 'pull_request'
needs: [ run-tests, build-and-push-base-image ]
runs-on: ubuntu-latest
strategy:
matrix:
application: [ fmriprep, AFNI, fsl, HCP, SPM ]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker - Application images
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/sea-${{ matrix.application }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: containers/applications/Dockerfile.${{ matrix.application }}
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}