-
Notifications
You must be signed in to change notification settings - Fork 23
411 lines (399 loc) · 19 KB
/
main.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# This is a definition file for GitHub CI.
name: GitHub CI
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
static_checks_debian_stable_x86_64:
runs-on: ubuntu-latest
container:
image: debian:stable
timeout-minutes: 60
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R . /dcma
- name: install_dependencies
run: |
export DEBIAN_FRONTEND="noninteractive"
apt-get update --yes
apt-get install --yes --no-install-recommends coreutils binutils findutils grep sed
- name: check_for_common_nonthreadsafe_nonreentrant_functions
run: |
./scripts/perform_static_checks.sh
build_cross_mxe_x86_64:
runs-on: ubuntu-latest
container:
image: "hdclark/dcma_build_base_mxe:latest"
timeout-minutes: 120
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R ./docker/builders/mxe /scratch
cp -R . /dcma
./scripts/enable_swapfile.sh
- name: build
run: |
( ( while true ; do sleep 225 ; printf '\n\n' ; df -h ; printf '\n\n' ; free || true ; printf '\n\n' ; done ) &)
./docker/builders/mxe/implementation_mxe.sh
rsync -avP /out/ ./Windows/
strip ./Windows/usr/bin/*exe
strip ./Windows/usr/lib/*a
( cd ./Windows/usr/bin/ && mv opengl32.dll opengl32_disabled.dll ) || true
git config --global --add safe.directory '*' || true
- name: test
run: |
export DEBIAN_FRONTEND='noninteractive'
sed -i -e 's@stable@bullseye@g' /etc/apt/sources.list
apt-get update --yes
apt-get install --yes --no-install-recommends git ca-certificates rsync mesa-utils
dpkg --add-architecture i386
apt-get update --yes
apt-get install --yes wine32 wine64
mkdir -pv wine-conf-dir
chown "$(id -u)":"$(id -g)" wine-conf-dir
export WINEPREFIX="$(pwd)/wine-conf-dir/.wine-prefix"
find ./Windows/usr/bin/ -type f -exec chmod 777 '{}' \;
rsync -a ./Windows/ /opt/
echo '#!/bin/bash' > /usr/bin/dicomautomaton_dispatcher
echo 'exec wine /opt/usr/bin/dicomautomaton_dispatcher.exe "$@"' >> /usr/bin/dicomautomaton_dispatcher
chmod 777 /usr/bin/dicomautomaton_dispatcher
dicomautomaton_dispatcher -h
./integration_tests/Run.sh -v
- name: create_zip
run: |
export short_sha="$(git rev-parse --short HEAD || printf 'unknown')"
export DEBIAN_FRONTEND="noninteractive"
apt-get update --yes
apt-get install --yes --no-install-recommends coreutils binutils findutils rsync openssh-client patchelf zip
rm -rf ci_artifacts
mkdir -pv ci_artifacts
( cd ./Windows/ && zip -r ../ci_artifacts/DICOMautomaton-latest-x86_64.zip . )
cp ci_artifacts/DICOMautomaton-latest-x86_64.zip "ci_artifacts/DICOMautomaton-${short_sha}-x86_64.zip"
find ci_artifacts/ -iname '*.zip' -print -execdir bash -c 'sha256sum "$@" > "$@".sha256sum' bash '{}' \;
- name: deploy_to_github
uses: actions/upload-artifact@v3
with:
name: "DICOMautomaton-exes"
if-no-files-found: error
path: |
ci_artifacts/DICOMautomaton-latest-x86_64.zip
ci_artifacts/DICOMautomaton-latest-x86_64.zip.sha256sum
- name: deploy_to_halclark_ca
run: |
echo "${{secrets.HALCLARKCA_DEPLOY_KEY}}" > deploy_key
chmod 600 deploy_key
for i in `seq 1 20` ; do sleep 5 ; rsync -avP -e 'ssh -v -i deploy_key -o ServerAliveInterval=30 -o ServerAliveCountMax=5 -o StrictHostKeyChecking=no' ci_artifacts/ [email protected]:/var/www/html/ci/ && break ; done
build_debian_buster_x86_64:
runs-on: ubuntu-latest
container:
image: debian:buster
timeout-minutes: 120
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R ./docker/builders/ci /scratch
cp -R . /dcma
./scripts/enable_swapfile.sh
- name: build
run: |
( ( while true ; do sleep 225 ; printf '\n\n' ; df -h ; printf '\n\n' ; free || true ; printf '\n\n' ; done ) &)
./docker/builders/ci/implementation_ci_debian_buster.sh
git config --global --add safe.directory '*' || true
- name: test
run: |
./integration_tests/Run.sh -v
- name: create_appimage
run: |
./scripts/extract_system_appimage.sh
export DEBIAN_FRONTEND="noninteractive"
apt-get update --yes
apt-get install --yes --no-install-recommends coreutils binutils findutils rsync openssh-client patchelf
rm -rf ci_artifacts
mkdir -pv ci_artifacts
cp DICOMautomaton*AppImage DICOMautomaton-latest-x86_64.AppImage
mv DICOMautomaton*AppImage ci_artifacts/
find ci_artifacts/ -iname '*AppImage' -print -execdir bash -c 'sha256sum "$@" > "$@".sha256sum' bash '{}' \;
- name: deploy_to_github
uses: actions/upload-artifact@v3
with:
name: "DICOMautomaton-AppImage"
if-no-files-found: error
path: |
ci_artifacts/DICOMautomaton-latest-x86_64.AppImage
ci_artifacts/DICOMautomaton-latest-x86_64.AppImage.sha256sum
- name: deploy_to_halclark_ca
run: |
echo "${{secrets.HALCLARKCA_DEPLOY_KEY}}" > deploy_key
chmod 600 deploy_key
for i in `seq 1 20` ; do sleep 5 ; rsync -avP -e 'ssh -v -i deploy_key -o ServerAliveInterval=30 -o ServerAliveCountMax=5 -o StrictHostKeyChecking=no' ci_artifacts/ [email protected]:/var/www/html/ci/ && break ; done
build_debian_buster_aarch64:
runs-on: ubuntu-latest
container:
image: debian:buster
timeout-minutes: 360
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R ./docker/builders/ci /scratch
cp -R . /dcma
./scripts/enable_swapfile.sh
- name: build
run: |
( ( while true ; do sleep 225 ; printf '\n\n' ; df -h ; printf '\n\n' ; free || true ; printf '\n\n' ; done ) &)
./docker/build_bases/debian_buster/create_foreign_chroot.sh -d /debian_buster_aarch64 -s /run_in_chroot.sh -a arm64
cp -R /scratch /debian_buster_aarch64/scratch
cp -R /dcma /debian_buster_aarch64/dcma
/run_in_chroot.sh 'cd /dcma && ./docker/builders/ci/implementation_ci_debian_buster.sh'
- name: test
run: |
/run_in_chroot.sh 'cd /dcma && ./integration_tests/Run.sh -v'
- name: create_appimage
run: |
/run_in_chroot.sh 'cd /dcma && ./scripts/extract_system_appimage.sh'
export DEBIAN_FRONTEND="noninteractive"
apt-get update --yes
apt-get install --yes --no-install-recommends coreutils binutils findutils rsync openssh-client patchelf
rm -rf ci_artifacts
mkdir -pv ci_artifacts
cp /debian_buster_aarch64/dcma/DICOMautomaton*AppImage ci_artifacts/DICOMautomaton-latest-aarch64.AppImage
mv /debian_buster_aarch64/dcma/DICOMautomaton*AppImage ci_artifacts/
find ci_artifacts/ -iname '*AppImage' -print -execdir bash -c 'sha256sum "$@" > "$@".sha256sum' bash '{}' \;
- name: deploy_to_github
uses: actions/upload-artifact@v3
with:
name: "DICOMautomaton-AppImage"
if-no-files-found: error
path: |
ci_artifacts/DICOMautomaton-latest-aarch64.AppImage
ci_artifacts/DICOMautomaton-latest-aarch64.AppImage.sha256sum
- name: deploy_to_halclark_ca
run: |
echo "${{secrets.HALCLARKCA_DEPLOY_KEY}}" > deploy_key
chmod 600 deploy_key
for i in `seq 1 20` ; do sleep 5 ; rsync -avP -e 'ssh -v -i deploy_key -o ServerAliveInterval=30 -o ServerAliveCountMax=5 -o StrictHostKeyChecking=no' ci_artifacts/ [email protected]:/var/www/html/ci/ && break ; done
build_debian_buster_armhf:
runs-on: ubuntu-latest
container:
image: debian:buster
timeout-minutes: 360
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R ./docker/builders/ci /scratch
cp -R . /dcma
./scripts/enable_swapfile.sh
- name: build
run: |
( ( while true ; do sleep 225 ; printf '\n\n' ; df -h ; printf '\n\n' ; free || true ; printf '\n\n' ; done ) &)
./docker/build_bases/debian_buster/create_foreign_chroot.sh -d /debian_buster_armhf -s /run_in_chroot.sh -a armhf
cp -R /scratch /debian_buster_armhf/scratch
cp -R /dcma /debian_buster_armhf/dcma
/run_in_chroot.sh 'cd /dcma && ./docker/builders/ci/implementation_ci_debian_buster.sh'
- name: test
run: |
/run_in_chroot.sh 'cd /dcma && ./integration_tests/Run.sh -v'
- name: create_appimage
run: |
/run_in_chroot.sh 'cd /dcma && ./scripts/extract_system_appimage.sh'
export DEBIAN_FRONTEND="noninteractive"
apt-get update --yes
apt-get install --yes --no-install-recommends coreutils binutils findutils rsync openssh-client patchelf
rm -rf ci_artifacts
mkdir -pv ci_artifacts
cp /debian_buster_armhf/dcma/DICOMautomaton*AppImage ci_artifacts/DICOMautomaton-latest-armhf.AppImage
mv /debian_buster_armhf/dcma/DICOMautomaton*AppImage ci_artifacts/
find ci_artifacts/ -iname '*AppImage' -print -execdir bash -c 'sha256sum "$@" > "$@".sha256sum' bash '{}' \;
- name: deploy_to_github
uses: actions/upload-artifact@v3
with:
name: "DICOMautomaton-AppImage"
if-no-files-found: error
path: |
ci_artifacts/DICOMautomaton-latest-armhf.AppImage
ci_artifacts/DICOMautomaton-latest-armhf.AppImage.sha256sum
- name: deploy_to_halclark_ca
run: |
echo "${{secrets.HALCLARKCA_DEPLOY_KEY}}" > deploy_key
chmod 600 deploy_key
for i in `seq 1 20` ; do sleep 5 ; rsync -avP -e 'ssh -v -i deploy_key -o ServerAliveInterval=30 -o ServerAliveCountMax=5 -o StrictHostKeyChecking=no' ci_artifacts/ [email protected]:/var/www/html/ci/ && break ; done
build_static_alpine_armv7:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R . ~/dcma
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update --yes
sudo apt-get install --yes --no-install-recommends coreutils binutils findutils rsync openssh-client patchelf qemu binfmt-support qemu-user-static
sudo ./docker/build_bases/alpine/setup_host.sh
sudo ./scripts/enable_swapfile.sh
- name: authenticate_with_dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build
run: |
( ( while true ; do sleep 225 ; printf '\n\n' ; df -h ; printf '\n\n' ; free || true ; printf '\n\n' ; done ) &)
mkdir -pv ~/binaries/{bin,include,lib,share}
cd ~/dcma/
sudo docker run \
--privileged \
--network=host \
--platform=linux/arm/v7 \
-v ~/dcma:/dcma:rw \
-v ~/binaries:/usr/local:rw \
-v ~/dcma/docker/build_bases/alpine:/build_base:rw \
-v ~/dcma/docker/builders/alpine:/scratch:rw \
'hdclark/dicomautomaton_alpine_armv7' \
'/dcma/docker/builders/alpine/implementation_alpine.sh'
sudo chown --recursive $USER:$USER ~/binaries
- name: test
run: |
find ~/binaries/ -type f -execdir chmod 777 '{}' \;
sudo cp ~/binaries/bin/dicomautomaton_dispatcher /usr/bin/
cd ~/dcma && ./integration_tests/Run.sh -v
- name: gather_files
run: |
mkdir -pv ~/ci_artifacts/
cp ~/binaries/bin/dicomautomaton_dispatcher ~/ci_artifacts/DICOMautomaton-${GITHUB_SHA::8}-armv7.static
cp ~/binaries/bin/dicomautomaton_dispatcher ~/ci_artifacts/DICOMautomaton-latest-armv7.static
find ~/ci_artifacts/ -type f -iname '*static' -print -execdir bash -c 'sha256sum "$@" > "$@".sha256sum' bash '{}' \;
- name: deploy_to_github
uses: actions/upload-artifact@v3
with:
name: "DICOMautomaton-static"
if-no-files-found: error
path: |
~/ci_artifacts/DICOMautomaton-latest-armv7.static
~/ci_artifacts/DICOMautomaton-latest-armv7.static.sha256sum
- name: deploy_to_halclark_ca
run: |
echo "${{secrets.HALCLARKCA_DEPLOY_KEY}}" > deploy_key
chmod 600 deploy_key
for i in `seq 1 20` ; do sleep 5 ; rsync -avP -e 'ssh -v -i deploy_key -o ServerAliveInterval=30 -o ServerAliveCountMax=5 -o StrictHostKeyChecking=no' ~/ci_artifacts/ [email protected]:/var/www/html/ci/ && break ; done
build_static_alpine_x86_64:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R . ~/dcma
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update --yes
sudo apt-get install --yes --no-install-recommends coreutils binutils findutils rsync openssh-client patchelf qemu binfmt-support qemu-user-static
sudo ./docker/build_bases/alpine/setup_host.sh
sudo ./scripts/enable_swapfile.sh
- name: authenticate_with_dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build
run: |
( ( while true ; do sleep 225 ; printf '\n\n' ; df -h ; printf '\n\n' ; free || true ; printf '\n\n' ; done ) &)
mkdir -pv ~/binaries/{bin,include,lib,share}
cd ~/dcma/
sudo docker run \
--privileged \
--network=host \
--platform=linux/amd64 \
-v ~/dcma:/dcma:rw \
-v ~/binaries:/usr/local:rw \
-v ~/dcma/docker/build_bases/alpine:/build_base:rw \
-v ~/dcma/docker/builders/alpine:/scratch:rw \
'hdclark/dicomautomaton_alpine_x86_64' \
'/dcma/docker/builders/alpine/implementation_alpine.sh'
sudo chown --recursive $USER:$USER ~/binaries
- name: test
run: |
find ~/binaries/ -type f -execdir chmod 777 '{}' \;
sudo cp ~/binaries/bin/dicomautomaton_dispatcher /usr/bin/
cd ~/dcma && ./integration_tests/Run.sh -v
- name: gather_files
run: |
mkdir -pv ~/ci_artifacts/
cp ~/binaries/bin/dicomautomaton_dispatcher ~/ci_artifacts/DICOMautomaton-${GITHUB_SHA::8}-x86_64.static
cp ~/binaries/bin/dicomautomaton_dispatcher ~/ci_artifacts/DICOMautomaton-latest-x86_64.static
find ~/ci_artifacts/ -type f -iname '*static' -print -execdir bash -c 'sha256sum "$@" > "$@".sha256sum' bash '{}' \;
- name: deploy_to_github
uses: actions/upload-artifact@v3
with:
name: "DICOMautomaton-static"
if-no-files-found: error
path: |
~/ci_artifacts/DICOMautomaton-latest-x86_64.static
~/ci_artifacts/DICOMautomaton-latest-x86_64.static.sha256sum
- name: deploy_to_halclark_ca
run: |
echo "${{secrets.HALCLARKCA_DEPLOY_KEY}}" > deploy_key
chmod 600 deploy_key
for i in `seq 1 20` ; do sleep 5 ; rsync -avP -e 'ssh -v -i deploy_key -o ServerAliveInterval=30 -o ServerAliveCountMax=5 -o StrictHostKeyChecking=no' ~/ci_artifacts/ [email protected]:/var/www/html/ci/ && break ; done
build_static_alpine_aarch64:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- uses: actions/checkout@v1
- name: prep
run: |
cp -R . ~/dcma
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update --yes
sudo apt-get install --yes --no-install-recommends coreutils binutils findutils rsync openssh-client patchelf qemu binfmt-support qemu-user-static
sudo ./docker/build_bases/alpine/setup_host.sh
sudo ./scripts/enable_swapfile.sh
- name: authenticate_with_dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build
run: |
( ( while true ; do sleep 225 ; printf '\n\n' ; df -h ; printf '\n\n' ; free || true ; printf '\n\n' ; done ) &)
mkdir -pv ~/binaries/{bin,include,lib,share}
cd ~/dcma/
sudo docker run \
--privileged \
--network=host \
--platform=linux/arm64 \
-v ~/dcma:/dcma:rw \
-v ~/binaries:/usr/local:rw \
-v ~/dcma/docker/build_bases/alpine:/build_base:rw \
-v ~/dcma/docker/builders/alpine:/scratch:rw \
'hdclark/dicomautomaton_alpine_aarch64' \
'/dcma/docker/builders/alpine/implementation_alpine.sh'
sudo chown --recursive $USER:$USER ~/binaries
- name: test
run: |
find ~/binaries/ -type f -execdir chmod 777 '{}' \;
sudo cp ~/binaries/bin/dicomautomaton_dispatcher /usr/bin/
cd ~/dcma && ./integration_tests/Run.sh -v
- name: gather_files
run: |
mkdir -pv ~/ci_artifacts/
cp ~/binaries/bin/dicomautomaton_dispatcher ~/ci_artifacts/DICOMautomaton-${GITHUB_SHA::8}-aarch64.static
cp ~/binaries/bin/dicomautomaton_dispatcher ~/ci_artifacts/DICOMautomaton-latest-aarch64.static
find ~/ci_artifacts/ -type f -iname '*static' -print -execdir bash -c 'sha256sum "$@" > "$@".sha256sum' bash '{}' \;
- name: deploy_to_github
uses: actions/upload-artifact@v3
with:
name: "DICOMautomaton-static"
if-no-files-found: error
path: |
~/ci_artifacts/DICOMautomaton-latest-aarch64.static
~/ci_artifacts/DICOMautomaton-latest-aarch64.static.sha256sum
- name: deploy_to_halclark_ca
run: |
echo "${{secrets.HALCLARKCA_DEPLOY_KEY}}" > deploy_key
chmod 600 deploy_key
for i in `seq 1 20` ; do sleep 5 ; rsync -avP -e 'ssh -v -i deploy_key -o ServerAliveInterval=30 -o ServerAliveCountMax=5 -o StrictHostKeyChecking=no' ~/ci_artifacts/ [email protected]:/var/www/html/ci/ && break ; done