-
Notifications
You must be signed in to change notification settings - Fork 14
126 lines (112 loc) · 3.69 KB
/
main.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
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
---
name: Docker
on:
pull_request:
paths-ignore:
- "**.md"
- ruff.toml
- bumpver.toml
- .pre-commit-config.yaml
# We use doit only for local builds
- dodo.py
- aarch64-runner/**
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
build-amd64:
uses: ./.github/workflows/build.yml
with:
runsOn: ubuntu-22.04
platforms: linux/amd64
test-amd64:
needs: build-amd64
strategy:
fail-fast: false
matrix:
target: ["base", "lab", "base-with-services", "full-stack"]
uses: ./.github/workflows/test.yml
with:
runsOn: ubuntu-22.04
images: ${{ needs.build-amd64.outputs.images }}
target: ${{ matrix.target }}
integration: false
build:
needs: test-amd64
uses: ./.github/workflows/build.yml
with:
runsOn: ubuntu-22.04
platforms: linux/amd64,linux/arm64
# To save arm64 runner resources, we run the tests only on main
# and only for full-stack image (same for integration tests below).
test-arm64:
if: >-
github.repository == 'aiidalab/aiidalab-docker-stack'
&& (github.ref_type == 'tag' || github.ref_name == 'main')
needs: build
uses: ./.github/workflows/test.yml
with:
runsOn: buildjet-4vcpu-ubuntu-2204-arm
images: ${{ needs.build.outputs.images }}
target: full-stack
integration: false
test-integration:
name: Integration tests
needs: build
strategy:
fail-fast: false
# Trick to exclude arm64 tests from PRs
# https://github.com/orgs/community/discussions/26253
matrix:
runner: [ubuntu-22.04, buildjet-4vcpu-ubuntu-2204-arm]
isPR:
- ${{ github.event_name == 'pull_request' }}
exclude:
- isPR: true
runner: buildjet-4vcpu-ubuntu-2204-arm
uses: ./.github/workflows/test.yml
with:
runsOn: ${{ matrix.runner }}
images: ${{ needs.build.outputs.images }}
target: full-stack
integration: true
publish-ghcr:
needs: [build, test-amd64]
uses: ./.github/workflows/publish.yml
with:
runsOn: ubuntu-22.04
images: ${{ needs.build.outputs.images }}
registry: ghcr.io
secrets: inherit
publish-dockerhub:
if: >-
github.repository == 'aiidalab/aiidalab-docker-stack'
&& (github.ref_type == 'tag' || github.ref_name == 'main')
needs: [build, test-amd64, test-arm64, publish-ghcr]
uses: ./.github/workflows/publish.yml
with:
runsOn: ubuntu-22.04
images: ${{ needs.build.outputs.images }}
registry: docker.io
secrets: inherit
make-release:
runs-on: ubuntu-22.04
if: >-
github.repository == 'aiidalab/aiidalab-docker-stack'
&& github.ref_type == 'tag'
needs: [publish-dockerhub]
steps:
- uses: softprops/action-gh-release@v2
name: Create release
with:
generate_release_notes: true