Skip to content

Commit 4ad0e29

Browse files
authored
Merge pull request #2 from CCPBioSim/ci-alterations
optimise build/test WF
2 parents 7c7354a + c740251 commit 4ad0e29

File tree

1 file changed

+15
-50
lines changed

1 file changed

+15
-50
lines changed

.github/workflows/build.yaml

Lines changed: 15 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
build:
10+
timeout-minutes: 360
1011
strategy:
1112
fail-fast: false
1213
matrix:
@@ -60,6 +61,13 @@ jobs:
6061
tags: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
6162
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
6263

64+
- name: Test notebooks
65+
shell: bash
66+
run: |
67+
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
68+
pip install pytest nbmake; \
69+
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;"
70+
6371
- name: Export digest
6472
run: |
6573
mkdir -p ${{ runner.temp }}/digests
@@ -74,9 +82,10 @@ jobs:
7482
if-no-files-found: error
7583
retention-days: 1
7684

77-
merge:
85+
tags:
86+
if: github.event_name != 'pull_request'
7887
runs-on: ubuntu-24.04
79-
name: merge into multiarch manifest
88+
name: merge and tag
8089
needs:
8190
- build
8291
steps:
@@ -104,7 +113,9 @@ jobs:
104113
uses: docker/[email protected]
105114
with:
106115
images: ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
107-
tags: dev
116+
tags: |
117+
latest
118+
${{ needs.build.outputs.tag }}
108119
109120
- name: Create manifest list and push
110121
id: annotate
@@ -128,53 +139,7 @@ jobs:
128139
129140
- name: Inspect image
130141
run: |
131-
docker buildx imagetools inspect ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev
132-
133-
tests:
134-
strategy:
135-
fail-fast: false
136-
matrix:
137-
platform:
138-
- linux/amd64
139-
- linux/arm64
140-
runs-on: ${{ matrix.platform == 'linux/amd64' && 'ubuntu-latest' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }}
141-
name: testing on ${{ matrix.platform }}
142-
timeout-minutes: 360
143-
needs:
144-
- build
145-
- merge
146-
steps:
147-
148-
- name: Test notebooks
149-
shell: bash
150-
run: |
151-
docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev bash -c " \
152-
pip install pytest nbmake; \
153-
find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600;"
154-
155-
tags:
156-
runs-on: ubuntu-24.04
157-
if: github.event_name != 'pull_request'
158-
name: add tags
159-
needs:
160-
- build
161-
- tests
162-
steps:
163-
- name: Authenticate with GHCR
164-
id: auth
165-
uses: docker/[email protected]
166-
with:
167-
registry: "ghcr.io"
168-
username: ${{github.actor}}
169-
password: ${{secrets.BUILD_TOKEN}}
170-
171-
- name: tag release versions
172-
shell: bash
173-
run: |
174-
docker buildx imagetools create \
175-
--tag ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest \
176-
--tag ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:${{ needs.build.outputs.tag }} \
177-
ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:dev
142+
docker buildx imagetools inspect ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest
178143
179144
- name: Post version update to dash
180145
uses: peter-evans/[email protected]

0 commit comments

Comments
 (0)