Skip to content

Commit

Permalink
Build amd64 first
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed May 21, 2024
1 parent 6c4fe7b commit 6d71fc0
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,42 @@ env:
FORCE_COLOR: 1

jobs:
build:
# We build only amd64 first to catch failures faster.
build-amd64:
uses: ./.github/workflows/docker-build.yml
with:
runsOn: ubuntu-22.04
platforms: linux/amd64

test-amd64:
needs: build
needs: build-amd64
uses: ./.github/workflows/docker-test.yml
strategy:
matrix:
target: [aiida-core-base, aiida-core-with-services, aiida-core-dev]
with:
runsOn: ubuntu-22.04
images: ${{ needs.build.outputs.images }}
images: ${{ needs.build-amd64.outputs.images }}
target: ${{ matrix.target }}

build:
uses: ./.github/workflows/docker-build.yml
with:
runsOn: ubuntu-22.04
platforms: linux/amd64,linux/arm64

publish-ghcr:
needs: [build, test-amd64]
uses: ./.github/workflows/docker-publish.yml
secrets: inherit
with:
runsOn: ubuntu-22.04
images: ${{ needs.build.outputs.images }}
registry: ghcr.io

# IMPORTANT: To save arm64 runners resources,
# we run the test only when pushing to main.
# We also only test the aiida-core-dev image
# We also only test the aiida-core-dev image.
test-arm64:
needs: build
if: >-
Expand All @@ -59,15 +75,6 @@ jobs:
images: ${{ needs.build.outputs.images }}
target: aiida-core-dev

publish-ghcr:
needs: [build, test-amd64]
uses: ./.github/workflows/docker-publish.yml
secrets: inherit
with:
runsOn: ubuntu-22.04
images: ${{ needs.build.outputs.images }}
registry: ghcr.io

publish-dockerhub:
if: >-
github.repository == 'aiidateam/aiida-core'
Expand Down

0 comments on commit 6d71fc0

Please sign in to comment.