forked from svalinn/DAGMC
-
Notifications
You must be signed in to change notification settings - Fork 0
373 lines (326 loc) · 11.8 KB
/
docker_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
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
name: Build & Publish docker image for DAGMC-CI
on:
# allows us to run workflows manually
workflow_dispatch:
push:
paths:
- 'CI/?ocker**'
- '.github/workflows/docker_publish.yml'
jobs:
build-base-img:
runs-on: ubuntu-latest
strategy:
matrix:
ubuntu_versions : [
18.04,
20.04,
]
name: Ubuntu ${{ matrix.ubuntu_versions }} basics deps
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Export Dockerfile_0_base
uses: docker/build-push-action@v2
with:
file: CI/Dockerfile
target: base
push: true
context: .
build-args: |
UBUNTU_VERSION=${{ matrix.ubuntu_versions }}
tags: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}:ci_testing
build-housekeeping-img:
needs: build-base-img
runs-on: ubuntu-latest
env:
hdf5_versions: 1.10.4
hdf5_build_dir: hdf5_build_dir
strategy:
matrix:
ubuntu_versions : [18.04,]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and push Dockerfile_1_housekeeping
uses: docker/build-push-action@v2
with:
file: CI/Dockerfile_1_housekeeping
context: .
push: true
build-args: |
OWNER=${{ github.repository_owner }}
TAG=ci_testing
UBUNTU_VERSION=${{ matrix.ubuntu_versions }}
tags: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping:ci_testing
build-deps-img:
needs: build-base-img
runs-on: ubuntu-latest
strategy:
matrix:
ubuntu_versions : [
18.04,
20.04,
]
compiler : [
gcc,
clang,
]
hdf5_versions : [
1.10.4,
]
name: Ubuntu ${{ matrix.ubuntu_versions }} + ${{ matrix.compiler }} hdf5 ${{ matrix.hdf5_versions }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and push Dockerfile_1_external_deps
uses: docker/build-push-action@v2
with:
file: CI/Dockerfile
target: external_deps
context: .
push: false
build-args: |
OWNER=${{ github.repository_owner }}
TAG=ci_testing
UBUNTU_VERSION=${{ matrix.ubuntu_versions }}
COMPILER=${{ matrix.compiler }}
tags: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext:ci_testing
- name: Build and export Dockerfile_2_hdf5
uses: docker/build-push-action@v2
with:
file: CI/Dockerfile
target: hdf5
context: .
push: true
build-args: |
OWNER=${{ github.repository_owner }}
TAG=ci_testing
UBUNTU_VERSION=${{ matrix.ubuntu_versions }}
COMPILER=${{ matrix.compiler }}
HDF5=${{ matrix.hdf5_versions }}
tags: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}:ci_testing
build-moab-img:
needs: build-deps-img
runs-on: ubuntu-latest
env:
hdf5_versions: 1.10.4
hdf5_build_dir: hdf5_build_dir
strategy:
matrix:
ubuntu_versions : [
18.04,
20.04,
]
compiler : [
gcc,
clang,
]
hdf5_versions : [
1.10.4,
]
moab_versions : [
5.3.0,
]
name: Ubuntu ${{ matrix.ubuntu_versions }} + ${{ matrix.compiler }} hdf5 ${{ matrix.hdf5_versions }} + Moab ${{ matrix.moab_versions }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and push Dockerfile_3_moab
uses: docker/build-push-action@v2
with:
file: CI/Dockerfile
target: moab
context: .
push: true
build-args: |
OWNER=${{ github.repository_owner }}
TAG=ci_testing
UBUNTU_VERSION=${{ matrix.ubuntu_versions }}
COMPILER=${{ matrix.compiler }}
HDF5=${{ matrix.hdf5_versions }}
MOAB=${{ matrix.moab_versions }}
tags: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:ci_testing
housekeeping:
if: ${{ github.repository_owner != 'svalinn' || github.event_name == 'pull_request' }}
needs: [build-housekeeping-img]
runs-on: ubuntu-latest
env:
hdf5_versions: 1.10.4
hdf5_build_dir: hdf5_build_dir
strategy:
matrix:
ubuntu_versions : [18.04,]
container: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping:ci_testing
name: Running Housekeeping scrips
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
mkdir /root/build_dir/
echo "REPO_SLUG=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
echo "PULL_REQUEST=$(echo $GITHUB_REF | cut -d"/" -f3)" >> $GITHUB_ENV
ln -s $GITHUB_WORKSPACE /root/build_dir/DAGMC
- name: Run Housekeeping
run: |
cd $GITHUB_WORKSPACE
/bin/bash "CI/scripts/housekeeping.sh"
test_img:
needs: [build-moab-img]
runs-on: ubuntu-latest
env:
hdf5_versions: 1.10.4
hdf5_build_dir: hdf5_build_dir
strategy:
matrix:
ubuntu_versions : [
18.04,
20.04,
]
compiler : [
gcc,
clang,
]
hdf5_versions : [
1.10.4,
]
moab_versions : [
5.3.0,
]
container: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:ci_testing
name: Installing and Testing DAGMC
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git config --global --add safe.directory /github/home/
git config --global --add safe.directory /github/home/.cache
git config --global --add safe.directory /github/home/.cache/pip
git config --global --add safe.directory /github/home/.cache/pip/http
echo "MOAB_VERSION=${{ matrix.moab_versions }}" >> $GITHUB_ENV
echo "COMPILER=${{ matrix.compiler }}" >> $GITHUB_ENV
echo "HDF5_VERSION=${{ matrix.hdf5_versions }}" >> $GITHUB_ENV
echo "REPO_SLUG=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
echo "PULL_REQUEST=$(echo $GITHUB_REF | cut -d"/" -f3)" >> $GITHUB_ENV
echo "DOUBLE_DOWN="OFF"" >> $GITHUB_ENV
ln -s $GITHUB_WORKSPACE /root/build_dir/DAGMC
- name: Install DAGMC
run: |
cd $GITHUB_WORKSPACE
/bin/bash "CI/scripts/install.sh"
- name: Run DAGMC Test
run: |
cd $GITHUB_WORKSPACE
/bin/bash "CI/scripts/tests.sh"
pushing_housekeeping_stable_img:
if: ${{ github.repository_owner == 'svalinn' }}
needs: [test_img]
runs-on: ubuntu-latest
env:
hdf5_versions: 1.10.4
hdf5_build_dir: hdf5_build_dir
strategy:
matrix:
ubuntu_versions : [18.04,]
name: Housekeeping':' latest -> stable
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image as stable img
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping:ci_testing
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping:stable
- name: Push Image as latest img
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping:ci_testing
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping:latest
pushing_test_stable_img:
if: ${{ github.repository_owner == 'svalinn' }}
needs: [test_img]
runs-on: ubuntu-latest
env:
hdf5_versions: 1.10.4
hdf5_build_dir: hdf5_build_dir
strategy:
matrix:
ubuntu_versions : [
18.04,
20.04,
]
compiler : [
gcc,
clang,
]
hdf5_versions : [
1.10.4,
]
moab_versions : [
5.3.0,
]
name: Ubuntu${{ matrix.ubuntu_versions }} + ${{ matrix.compiler }} hdf5 ${{ matrix.hdf5_versions }} + Moab ${{ matrix.moab_versions }}':' latest -> stable
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image as stable img
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:ci_testing
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:stable
- name: Push Image as latest img
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:ci_testing
dst: ghcr.io/${{ github.repository_owner }}/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }}:latest