Skip to content

Commit b224ecf

Browse files
committed
Separate build and test jobs for CI
1 parent c17e49b commit b224ecf

6 files changed

Lines changed: 546 additions & 9 deletions

File tree

.github/workflows/action_branch.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ jobs:
5858
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
5959
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
6060

61+
base-test:
62+
needs:
63+
- params
64+
- configure
65+
- base
66+
uses: ./.github/workflows/zzz-reuse-test.yml
67+
with:
68+
enabled: true
69+
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
70+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
71+
has_refs: ${{ needs.configure.outputs.has_refs }}
72+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
73+
flavour: base
74+
secrets:
75+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
76+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
77+
6178

6279
# -----------------------------------------------------------------------------------------------
6380
# (4/8) Build & Test mods
@@ -67,6 +84,7 @@ jobs:
6784
- params
6885
- configure
6986
- base
87+
- base-test
7088
uses: ./.github/workflows/zzz-reuse-build.yml
7189
with:
7290
enabled: true
@@ -79,6 +97,25 @@ jobs:
7997
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
8098
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
8199

100+
mods-test:
101+
needs:
102+
- params
103+
- configure
104+
- base
105+
- base-test
106+
- mods
107+
uses: ./.github/workflows/zzz-reuse-test.yml
108+
with:
109+
enabled: true
110+
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
111+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
112+
has_refs: ${{ needs.configure.outputs.has_refs }}
113+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
114+
flavour: mods
115+
secrets:
116+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
117+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
118+
82119

83120
# -----------------------------------------------------------------------------------------------
84121
# (5/8) Build & Test prod
@@ -88,7 +125,9 @@ jobs:
88125
- params
89126
- configure
90127
- base
128+
- base-test
91129
- mods
130+
- mods-test
92131
uses: ./.github/workflows/zzz-reuse-build.yml
93132
with:
94133
enabled: true
@@ -101,6 +140,27 @@ jobs:
101140
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
102141
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
103142

143+
prod-test:
144+
needs:
145+
- params
146+
- configure
147+
- base
148+
- base-test
149+
- mods
150+
- mods-test
151+
- prod
152+
uses: ./.github/workflows/zzz-reuse-test.yml
153+
with:
154+
enabled: true
155+
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
156+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
157+
has_refs: ${{ needs.configure.outputs.has_refs }}
158+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
159+
flavour: prod
160+
secrets:
161+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
162+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
163+
104164

105165
# -----------------------------------------------------------------------------------------------
106166
# (6/8) Build & Test work
@@ -110,8 +170,11 @@ jobs:
110170
- params
111171
- configure
112172
- base
173+
- base-test
113174
- mods
175+
- mods-test
114176
- prod
177+
- prod-test
115178
uses: ./.github/workflows/zzz-reuse-build.yml
116179
with:
117180
enabled: true
@@ -124,6 +187,29 @@ jobs:
124187
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
125188
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
126189

190+
work-test:
191+
needs:
192+
- params
193+
- configure
194+
- base
195+
- base-test
196+
- mods
197+
- mods-test
198+
- prod
199+
- prod-test
200+
- work
201+
uses: ./.github/workflows/zzz-reuse-test.yml
202+
with:
203+
enabled: true
204+
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
205+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
206+
has_refs: ${{ needs.configure.outputs.has_refs }}
207+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
208+
flavour: work
209+
secrets:
210+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
211+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
212+
127213

128214
# -----------------------------------------------------------------------------------------------
129215
# (7/8) Push images
@@ -133,9 +219,13 @@ jobs:
133219
- params
134220
- configure
135221
- base
222+
- base-test
136223
- mods
224+
- mods-test
137225
- prod
226+
- prod-test
138227
- work
228+
- work-test
139229
uses: ./.github/workflows/zzz-reuse-deploy-images.yml
140230
with:
141231
enabled: true
@@ -156,9 +246,13 @@ jobs:
156246
- params
157247
- configure
158248
- base
249+
- base-test
159250
- mods
251+
- mods-test
160252
- prod
253+
- prod-test
161254
- work
255+
- work-test
162256
- push-image
163257
uses: ./.github/workflows/zzz-reuse-deploy-manifests.yml
164258
with:

.github/workflows/action_pull_request.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ jobs:
6060
dockerhub_username: ""
6161
dockerhub_password: ""
6262

63+
base-test:
64+
needs:
65+
- params
66+
- configure
67+
- base
68+
uses: ./.github/workflows/zzz-reuse-test.yml
69+
with:
70+
enabled: true
71+
can_deploy: false
72+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
73+
has_refs: ${{ needs.configure.outputs.has_refs }}
74+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
75+
flavour: base
76+
secrets:
77+
dockerhub_username: ""
78+
dockerhub_password: ""
79+
6380

6481
# -----------------------------------------------------------------------------------------------
6582
# (4/8) Build & Test mods
@@ -69,6 +86,7 @@ jobs:
6986
- params
7087
- configure
7188
- base
89+
- base-test
7290
uses: ./.github/workflows/zzz-reuse-build.yml
7391
with:
7492
enabled: true
@@ -81,6 +99,25 @@ jobs:
8199
dockerhub_username: ""
82100
dockerhub_password: ""
83101

102+
mods-test:
103+
needs:
104+
- params
105+
- configure
106+
- base
107+
- base-test
108+
- mods
109+
uses: ./.github/workflows/zzz-reuse-test.yml
110+
with:
111+
enabled: true
112+
can_deploy: false
113+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
114+
has_refs: ${{ needs.configure.outputs.has_refs }}
115+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
116+
flavour: mods
117+
secrets:
118+
dockerhub_username: ""
119+
dockerhub_password: ""
120+
84121

85122
# -----------------------------------------------------------------------------------------------
86123
# (5/8) Build & Test prod
@@ -90,7 +127,9 @@ jobs:
90127
- params
91128
- configure
92129
- base
130+
- base-test
93131
- mods
132+
- mods-test
94133
uses: ./.github/workflows/zzz-reuse-build.yml
95134
with:
96135
enabled: true
@@ -103,6 +142,27 @@ jobs:
103142
dockerhub_username: ""
104143
dockerhub_password: ""
105144

145+
prod-test:
146+
needs:
147+
- params
148+
- configure
149+
- base
150+
- base-test
151+
- mods
152+
- mods-test
153+
- prod
154+
uses: ./.github/workflows/zzz-reuse-test.yml
155+
with:
156+
enabled: true
157+
can_deploy: false
158+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
159+
has_refs: ${{ needs.configure.outputs.has_refs }}
160+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
161+
flavour: prod
162+
secrets:
163+
dockerhub_username: ""
164+
dockerhub_password: ""
165+
106166

107167
# -----------------------------------------------------------------------------------------------
108168
# (6/8) Build & Test work
@@ -112,8 +172,11 @@ jobs:
112172
- params
113173
- configure
114174
- base
175+
- base-test
115176
- mods
177+
- mods-test
116178
- prod
179+
- prod-test
117180
uses: ./.github/workflows/zzz-reuse-build.yml
118181
with:
119182
enabled: true
@@ -126,6 +189,29 @@ jobs:
126189
dockerhub_username: ""
127190
dockerhub_password: ""
128191

192+
work-test:
193+
needs:
194+
- params
195+
- configure
196+
- base
197+
- base-test
198+
- mods
199+
- mods-test
200+
- prod
201+
- prod-test
202+
- work
203+
uses: ./.github/workflows/zzz-reuse-test.yml
204+
with:
205+
enabled: true
206+
can_deploy: false
207+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
208+
has_refs: ${{ needs.configure.outputs.has_refs }}
209+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
210+
flavour: work
211+
secrets:
212+
dockerhub_username: ""
213+
dockerhub_password: ""
214+
129215

130216
# -----------------------------------------------------------------------------------------------
131217
# (7/8) Push images
@@ -135,9 +221,13 @@ jobs:
135221
- params
136222
- configure
137223
- base
224+
- base-test
138225
- mods
226+
- mods-test
139227
- prod
228+
- prod-test
140229
- work
230+
- work-test
141231
uses: ./.github/workflows/zzz-reuse-deploy-images.yml
142232
with:
143233
enabled: true
@@ -158,9 +248,13 @@ jobs:
158248
- params
159249
- configure
160250
- base
251+
- base-test
161252
- mods
253+
- mods-test
162254
- prod
255+
- prod-test
163256
- work
257+
- work-test
164258
- push-image
165259
uses: ./.github/workflows/zzz-reuse-deploy-manifests.yml
166260
with:

0 commit comments

Comments
 (0)