-
Notifications
You must be signed in to change notification settings - Fork 6
351 lines (351 loc) · 11.9 KB
/
development.yaml
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
name: Development
on:
push:
tags:
- '*.*.*'
# pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: alpine
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.12'
platform: linux/amd64
py_label: py310_
conda_sha256: 634d76df5e489c44ade4085552b97bebc786d49245ed1a830022b0b406de5817
- distro: alpine
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.11'
platform: linux/amd64
py_label: py310_
conda_sha256: 634d76df5e489c44ade4085552b97bebc786d49245ed1a830022b0b406de5817
- distro: alpine
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.10'
platform: linux/amd64
py_label: py310_
conda_sha256: ea5e6e8a3d5a0247b9df85382d27220fac8e59b5778fd313c5913879cd9baafc
- distro: alpine
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.9'
platform: linux/amd64
py_label: py39_
conda_sha256: 9829d95f639bd0053b2ed06d1204e60644617bf37dd5cc57523732e0e8d64516
- distro: alpine
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.8'
platform: linux/amd64
py_label: py38_
conda_sha256: e2a4438671e0e42c5bba14cb51de6ce9763938184d6ca2967340bbe972bbe7e6
- distro: debian
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.12'
platform: linux/amd64
py_label: py310_
conda_sha256: 634d76df5e489c44ade4085552b97bebc786d49245ed1a830022b0b406de5817
- distro: debian
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.11'
platform: linux/amd64
py_label: py310_
conda_sha256: 634d76df5e489c44ade4085552b97bebc786d49245ed1a830022b0b406de5817
- distro: debian
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.10'
platform: linux/amd64
py_label: py310_
conda_sha256: ea5e6e8a3d5a0247b9df85382d27220fac8e59b5778fd313c5913879cd9baafc
- distro: debian
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.9'
platform: linux/amd64
py_label: py39_
conda_sha256: 9829d95f639bd0053b2ed06d1204e60644617bf37dd5cc57523732e0e8d64516
- distro: debian
conda_ver: '23.5.2'
conda_suffix: '-0'
py_ver: '3.8'
platform: linux/amd64
py_label: py38_
conda_sha256: e2a4438671e0e42c5bba14cb51de6ce9763938184d6ca2967340bbe972bbe7e6
env:
DISTRO: ${{matrix.distro}}
CONDA_VER: ${{matrix.conda_ver}}
CONDA_SUFFIX: ${{matrix.conda_suffix}}
PY_VER: ${{matrix.py_ver}}
PLATFORM: ${{matrix.platform}}
PY_LABEL: ${{matrix.py_label}}
CONDA_SHA256: ${{matrix.conda_sha256}}
DOCKER_CLIENT_TIMEOUT: "120"
COMPOSE_HTTP_TIMEOUT: "120"
steps:
- uses: actions/checkout@v3
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- uses: dbhi/qus/action@main
with:
targets: aarch64
# - name: Set up QEMU
# id: qemu
# uses: docker/setup-qemu-action@v1
# with:
# image: tonistiigi/binfmt:latest
# platforms: all
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v1
- name: Compile image
run: |
docker buildx bake -f dist/${DISTRO}/docker-compose.yaml \
--set *.platform=${PLATFORM} --set *.context=. --load
REF=$(eval "echo $(cat dist/${DISTRO}/docker-compose.yaml | grep 'image:' | \
awk '{print $2}')")
docker save "${REF}" | \
gzip > "${CONDA_VER}-py${PY_VER}-${DISTRO}-${PLATFORM_TAG}.tar.gz"
- name: Add image artifact
uses: actions/upload-artifact@v3
with:
name: >
${{format('{0}-py{1}-{2}-{3}', matrix.conda_ver, matrix.py_ver, matrix.distro,
env.PLATFORM_TAG)}}
path: >
${{format('{0}-py{1}-{2}-{3}.tar.gz', matrix.conda_ver, matrix.py_ver,
matrix.distro, env.PLATFORM_TAG)}}
retention-days: 1
test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: alpine
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.12'
platform: linux/amd64
package_manager: apk
- distro: alpine
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.11'
platform: linux/amd64
package_manager: apk
- distro: alpine
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.10'
platform: linux/amd64
package_manager: apk
- distro: alpine
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.9'
platform: linux/amd64
package_manager: apk
- distro: alpine
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.8'
platform: linux/amd64
package_manager: apk
- distro: debian
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.12'
platform: linux/amd64
package_manager: apt
- distro: debian
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.11'
platform: linux/amd64
package_manager: apt
- distro: debian
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.10'
platform: linux/amd64
package_manager: apt
- distro: debian
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.9'
platform: linux/amd64
package_manager: apt
- distro: debian
last_build_conda_ver: '22.11.1'
conda_ver: '23.5.2'
py_ver: '3.8'
platform: linux/amd64
package_manager: apt
env:
DISTRO: ${{matrix.distro}}
LAST_BUILD_CONDA_VER: ${{matrix.last_build_conda_ver}}
CONDA_VER: ${{matrix.conda_ver}}
PY_VER: ${{matrix.py_ver}}
PLATFORM: ${{matrix.platform}}
PACKAGE_MANAGER: ${{matrix.package_manager}}
steps:
- uses: actions/checkout@v3
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- name: Fetch image artifact
uses: actions/download-artifact@v3
with:
name: >
${{format('{0}-py{1}-{2}-{3}', matrix.conda_ver, matrix.py_ver, matrix.distro,
env.PLATFORM_TAG)}}
- uses: dbhi/qus/action@main
with:
targets: aarch64
- name: Run integration tests
run: |
export HOST_UID=$(id -u)
docker load < "${CONDA_VER}-py${PY_VER}-${DISTRO}-${PLATFORM_TAG}.tar.gz"
tests/main.sh
publish:
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
(
github.repository_owner == 'datajoint' ||
github.repository_owner == 'datajoint-company'
)
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: alpine
conda_ver: '23.5.2'
py_ver: '3.12'
platform: linux/amd64
- distro: alpine
conda_ver: '23.5.2'
py_ver: '3.11'
platform: linux/amd64
- distro: alpine
conda_ver: '23.5.2'
py_ver: '3.10'
platform: linux/amd64
- distro: alpine
conda_ver: '23.5.2'
py_ver: '3.9'
platform: linux/amd64
- distro: alpine
conda_ver: '23.5.2'
py_ver: '3.8'
platform: linux/amd64
- distro: debian
conda_ver: '23.5.2'
py_ver: '3.12'
platform: linux/amd64
- distro: debian
conda_ver: '23.5.2'
py_ver: '3.11'
platform: linux/amd64
- distro: debian
conda_ver: '23.5.2'
py_ver: '3.10'
platform: linux/amd64
- distro: debian
conda_ver: '23.5.2'
py_ver: '3.9'
platform: linux/amd64
- distro: debian
conda_ver: '23.5.2'
py_ver: '3.8'
platform: linux/amd64
env:
DISTRO: ${{matrix.distro}}
CONDA_VER: ${{matrix.conda_ver}}
PY_VER: ${{matrix.py_ver}}
PLATFORM: ${{matrix.platform}}
DOCKER_USERNAME: ${{secrets.docker_username}}
DOCKER_PASSWORD: ${{secrets.docker_password}}
steps:
- uses: actions/checkout@v3
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- name: Fetch image artifact
uses: actions/download-artifact@v3
with:
name: >
${{format('{0}-py{1}-{2}-{3}', matrix.conda_ver, matrix.py_ver, matrix.distro,
env.PLATFORM_TAG)}}
- name: Publish image
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker load < "${CONDA_VER}-py${PY_VER}-${DISTRO}-${PLATFORM_TAG}.tar.gz"
REF=$(eval "echo $(cat dist/${DISTRO}/docker-compose.yaml | grep 'image:' | \
awk '{print $2}')")
TAG=$(echo $REF | awk -F':' '{print $2}')
IMAGE=$(echo $REF | awk -F':' '{print $1}')
docker push "${IMAGE}:${TAG}"
docker tag "${IMAGE}:${TAG}" "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
docker push "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
[ "$PY_VER" == "3.12" ] && [ "$DISTRO" == "debian" ] \
&& docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \
&& docker push "${IMAGE}:latest" \
|| echo "skipping 'latest' tag..."
publish-docs:
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
(
github.repository_owner == 'datajoint' ||
github.repository_owner == 'datajoint-company'
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build docs
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
# - name: Upload docs artifact
# uses: actions/upload-artifact@v3
# with:
# name: docs-html
# path: docs/_build/html/
# retention-days: 1
- name: Commit documentation changes
run: |
git clone https://github.com/${GITHUB_REPOSITORY}.git \
--branch gh-pages --single-branch gh-pages
rm -R gh-pages/*
cp -r docs/_build/html/* gh-pages/
cp .gitignore gh-pages/
touch gh-pages/.nojekyll
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add . --all
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{secrets.GITHUB_TOKEN}}