-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (61 loc) · 1.77 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
name: Test container build and tutorials
on:
push:
branches:
- main
env:
TUTORIAL_TAG: tutorial_tag_local
TUTORIAL_IMAGE_NAME: tutorial_image
jobs:
build:
name: Build container locally
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: ./src/
file: ./docker/Dockerfile
build-args: |
TUTORIAL_NAME=latest
tags: ${{ env.TUTORIAL_TAG }}
outputs: type=docker,dest=/tmp/${{ env.TUTORIAL_IMAGE_NAME }}.tar
- uses: actions/upload-artifact@v4
with:
name: ${{ env.TUTORIAL_IMAGE_NAME }}
path: /tmp/${{ env.TUTORIAL_IMAGE_NAME }}.tar
retention-days: 1
overwrite: true
tests:
name: Test tutorials from docker container
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
tutorial: ['radical-pilot', 'radical-entk', 'parsl-rp', 'deepdrivemd']
env:
TARGET_PATH: /tutorials/${{ matrix.tutorial }}/*.ipynb
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ env.TUTORIAL_IMAGE_NAME }}
path: /tmp
- name: Load tutorial image
run: |
docker load --input /tmp/${{ env.TUTORIAL_IMAGE_NAME }}.tar
docker image ls -a
- name: Run tutorials
timeout-minutes: 20
run: |
docker run ${{ env.TUTORIAL_TAG }} bash -c "\
jupyter nbconvert --clear-output --inplace ${{ env.TARGET_PATH }} && \
jupyter nbconvert --to notebook --execute --inplace ${{ env.TARGET_PATH }}"
deploy:
name: Push container to DockerHub
needs: tests
uses: ./.github/workflows/deploy.yml
secrets: inherit