-
Notifications
You must be signed in to change notification settings - Fork 426
237 lines (196 loc) · 6 KB
/
ci.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: ci
on:
pull_request:
push:
branches:
- master
tags:
- 'v*.*.*'
jobs:
check_go_mod:
name: check_go_mod
runs-on: ubuntu-20.04
container: golang:1.17.3
steps:
- uses: actions/checkout@v2
- name: Check go.mod
run: ./scripts/check-go.mod
lint_markdown:
name: lint_markdown
runs-on: ubuntu-20.04
container: node:17-slim
steps:
- uses: actions/checkout@v2
- name: Install markdownlint
run: npm install -g markdownlint-cli
- name: Check for Lint
run: markdownlint .
check_source:
name: check_source
runs-on: ubuntu-20.04
container: golangci/golangci-lint:v1.43
steps:
- uses: actions/checkout@v2
- name: Check singularity source
run: |
./mconfig -v -p /usr/local
make -C ./builddir check
debian:
name: debian
runs-on: ubuntu-20.04
container: golang:1.17.3-buster
steps:
- name: Fetch deps
run: |
apt-get -q update && apt-get -q install -y build-essential libssl-dev uuid-dev squashfs-tools cryptsetup-bin
- uses: actions/checkout@v2
- name: Build Singularity
run: |
./mconfig -v -p /usr/local
make -C ./builddir all
alpine:
name: alpine
runs-on: ubuntu-20.04
container: golang:1.17.3-alpine
steps:
- name: Fetch deps
run: apk add -q --no-cache git alpine-sdk automake libtool linux-headers libarchive-dev util-linux-dev libuuid openssl-dev gawk sed cryptsetup
- uses: actions/checkout@v2
- name: Build Singularity
run: |
./mconfig -v -p /usr/local
make -C ./builddir all
oldgo:
name: oldgo
runs-on: ubuntu-20.04
# match the minimum version required by mconfig
container: golang:1.16-alpine
steps:
- name: Fetch deps
run: apk add -q --no-cache git alpine-sdk automake libtool linux-headers libarchive-dev util-linux-dev libuuid openssl-dev gawk sed cryptsetup
- uses: actions/checkout@v2
- name: Build Singularity
run: |
./mconfig -v -p /usr/local
make -C ./builddir all
rpmbuild-centos7:
runs-on: ubuntu-20.04
name: rpmbuild-centos7
steps:
- uses: actions/checkout@v2
- name: Build and test rpm under docker
env:
OS_TYPE: centos
OS_VERSION: 7
run: ./scripts/ci-docker-run
rpmbuild-rocky8:
runs-on: ubuntu-20.04
name: rpmbuild-rocky8
steps:
- uses: actions/checkout@v2
- name: Build and test rpm under docker
env:
OS_TYPE: rockylinux/rockylinux
OS_VERSION: 8
run: ./scripts/ci-docker-run
short_unit_tests:
name: short_unit_tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.3
- name: Fetch deps
run: sudo apt-get install -y build-essential squashfs-tools libseccomp-dev cryptsetup
- name: Build and install Singularity
run: |
./mconfig -v -p /usr/local
make -C ./builddir all && sudo make -C ./builddir install
- name: Run unit tests
run: make -C ./builddir short-unit-test
integration_tests:
name: integration_tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.3
- name: Fetch deps
run: sudo apt-get install -y build-essential squashfs-tools libseccomp-dev cryptsetup
- name: Build and install Singularity
run: |
./mconfig -v -p /usr/local
make -C ./builddir all && sudo make -C ./builddir install
- name: Run integration tests
run: make -C ./builddir integration-test
e2e_tests:
name: e2e_tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get git tags
run: git fetch --prune --unshallow --tags --force
- name: Check changes
env:
PROJECT_REPOSITORY: ${{ github.repository }}
PROJECT_PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
rc=0
./scripts/should-e2e-run "${PROJECT_REPOSITORY}" "${GITHUB_REF##*/}" "${PROJECT_PR_NUMBER}" || rc=$?
case $rc in
0)
echo "Verifying critical changes"
echo "run_tests=true" >> $GITHUB_ENV ;;
1)
echo "No critical changes, skipping tests" ;;
*)
echo "E: ./scripts/should-e2e-run returned with exit code $rc. Abort."
exit $rc ;;
esac
- name: Setup Go
if: env.run_tests
uses: actions/setup-go@v2
with:
go-version: 1.17.3
- name: Fetch deps
if: env.run_tests
run: sudo apt-get install -y build-essential squashfs-tools libseccomp-dev cryptsetup
- name: Build and install Singularity
if: env.run_tests
run: |
./mconfig -v -p /usr/local
make -C ./builddir all && sudo make -C ./builddir install
- name: Run E2E tests
if: env.run_tests
env:
E2E_PARALLEL: 8
run: make -C ./builddir e2e-test
- name: Upload artifacts
if: env.run_tests
uses: actions/upload-artifact@v2
with:
name: e2e-artifact
path: builddir/e2e-cmd-report.txt
retention-days: 7
check_pkg_no_buildcfg:
name: check_pkg_no_buildcfg
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.3
- name: Check pkg/... doesn't depend on buildcfg
run: |
if go list -f '{{.Deps}}' ./pkg/... | grep -q buildcfg
then
echo "Prohibited buildcfg dependency found in pkg/:"
echo
go list -f '{{.ImportPath}} - {{.Deps}}' ./pkg/... | grep buildcfg
exit 1
fi