1- name : build
2-
1+ name : ci/cd
32on :
3+ pull_request :
44 repository_dispatch :
55 types : [build]
66 workflow_dispatch :
7- inputs :
8- tag :
9- description : ' Base container version tag'
10- required : true
11- default : ' null'
127
138jobs :
149 build :
1914 - linux/amd64
2015 - linux/arm64
2116 runs-on : ${{ matrix.platform == 'linux/amd64' && 'ubuntu-24.04' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }}
22- name : ${{ matrix.platform }} workshop-build
17+ name : build ${{ matrix.platform }}
18+ outputs :
19+ tag : ${{ steps.envvars.outputs.tag }}
2320 steps :
2421 - name : checkout
2522 uses : actions/checkout@v5.0.0
2926 run : |
3027 platform=${{ matrix.platform }}
3128 echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
29+ if [ ${{ github.event.client_payload.tag }} != 'null' ]; then
30+ echo "tag=${{ github.event.client_payload.tag }}" >> $GITHUB_OUTPUT
31+ else
32+ echo "tag=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
33+ fi
3234
3335 - name : Metadata
3436 id : meta
7375
7476 merge :
7577 runs-on : ubuntu-24.04
78+ name : merge into multiarch manifest
7679 needs :
7780 - build
7881 steps :
@@ -100,8 +103,7 @@ jobs:
100103 uses : docker/metadata-action@v5.8.0
101104 with :
102105 images : ghcr.io/${{ github.repository }}
103- tags : |
104- dev
106+ tags : dev
105107
106108 - name : Create manifest list and push
107109 id : annotate
@@ -127,25 +129,48 @@ jobs:
127129 run : |
128130 docker buildx imagetools inspect ghcr.io/${{ github.repository }}:dev
129131
130- test :
131- runs-on : ubuntu-24.04
132- name : orchestrate tests
132+ tests :
133+ strategy :
134+ fail-fast : false
135+ matrix :
136+ platform :
137+ - linux/amd64
138+ - linux/arm64
139+ runs-on : ${{ matrix.platform == 'linux/amd64' && 'ubuntu-latest' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }}
140+ name : testing on ${{ matrix.platform }}
141+ timeout-minutes : 360
133142 needs :
143+ - build
134144 - merge
135145 steps :
136- - name : tag
137- id : version-tag
146+
147+ - name : Test notebooks
148+ shell : bash
138149 run : |
139- if [ ${{ github.event.inputs.tag }} != 'null' ]; then
140- echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
141- else
142- echo "tag=${{ github.event.client_payload.tag }}" >> $GITHUB_OUTPUT
143- fi
150+ docker run -t ghcr.io/${{ github.repository }}:dev bash -c " \
151+ pip install pytest nbmake; \
152+ find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
144153
145- - name : Dispatch Tests
146- uses : peter-evans/repository-dispatch@v3.0.0
154+ tags :
155+ runs-on : ubuntu-24.04
156+ if : github.event_name != 'pull_request'
157+ name : add tags
158+ needs :
159+ - build
160+ - tests
161+ steps :
162+ - name : Authenticate with GHCR
163+ id : auth
164+ uses : docker/login-action@v3.5.0
147165 with :
148- token : ${{ secrets.BUILD_TOKEN }}
149- repository : ${{ github.repository }}
150- event-type : test
151- client-payload : ' {"tag": "${{ steps.version-tag.outputs.tag }}"}'
166+ registry : " ghcr.io"
167+ username : ${{github.actor}}
168+ password : ${{secrets.BUILD_TOKEN}}
169+
170+ - name : tag release versions
171+ shell : bash
172+ run : |
173+ docker buildx imagetools create \
174+ --tag ghcr.io/${{ github.repository }}:latest \
175+ --tag ghcr.io/${{ github.repository }}:${{ needs.build.outputs.tag }} \
176+ ghcr.io/${{ github.repository }}:dev
0 commit comments