Skip to content

Commit a02163b

Browse files
authored
Merge pull request #236 from devilbox/ci-build-test-separation
Separate build and test jobs for CI
2 parents c17e49b + 35a3a9a commit a02163b

19 files changed

+585
-52
lines changed

.github/workflows/action_branch.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,28 @@ jobs:
5454
has_refs: ${{ needs.configure.outputs.has_refs }}
5555
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
5656
flavour: base
57+
run_tests: true
5758
secrets:
5859
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
5960
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
6061

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

6280
# -----------------------------------------------------------------------------------------------
6381
# (4/8) Build & Test mods
@@ -68,6 +86,25 @@ jobs:
6886
- configure
6987
- base
7088
uses: ./.github/workflows/zzz-reuse-build.yml
89+
with:
90+
enabled: true
91+
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
92+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
93+
has_refs: ${{ needs.configure.outputs.has_refs }}
94+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
95+
flavour: mods
96+
run_tests: false
97+
secrets:
98+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
99+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
100+
101+
mods-test:
102+
needs:
103+
- params
104+
- configure
105+
- base
106+
- mods
107+
uses: ./.github/workflows/zzz-reuse-test.yml
71108
with:
72109
enabled: true
73110
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
@@ -89,6 +126,7 @@ jobs:
89126
- configure
90127
- base
91128
- mods
129+
- mods-test
92130
uses: ./.github/workflows/zzz-reuse-build.yml
93131
with:
94132
enabled: true
@@ -97,10 +135,32 @@ jobs:
97135
has_refs: ${{ needs.configure.outputs.has_refs }}
98136
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
99137
flavour: prod
138+
run_tests: true
100139
secrets:
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
@@ -120,10 +180,34 @@ jobs:
120180
has_refs: ${{ needs.configure.outputs.has_refs }}
121181
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
122182
flavour: work
183+
run_tests: true
123184
secrets:
124185
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
125186
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
126187

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

128212
# -----------------------------------------------------------------------------------------------
129213
# (7/8) Push images

.github/workflows/action_pull_request.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,28 @@ jobs:
5656
has_refs: ${{ needs.configure.outputs.has_refs }}
5757
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
5858
flavour: base
59+
run_tests: true
5960
secrets:
6061
dockerhub_username: ""
6162
dockerhub_password: ""
6263

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

6482
# -----------------------------------------------------------------------------------------------
6583
# (4/8) Build & Test mods
@@ -70,6 +88,25 @@ jobs:
7088
- configure
7189
- base
7290
uses: ./.github/workflows/zzz-reuse-build.yml
91+
with:
92+
enabled: true
93+
can_deploy: false
94+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
95+
has_refs: ${{ needs.configure.outputs.has_refs }}
96+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
97+
flavour: mods
98+
run_tests: false
99+
secrets:
100+
dockerhub_username: ""
101+
dockerhub_password: ""
102+
103+
mods-test:
104+
needs:
105+
- params
106+
- configure
107+
- base
108+
- mods
109+
uses: ./.github/workflows/zzz-reuse-test.yml
73110
with:
74111
enabled: true
75112
can_deploy: false
@@ -91,6 +128,7 @@ jobs:
91128
- configure
92129
- base
93130
- mods
131+
- mods-test
94132
uses: ./.github/workflows/zzz-reuse-build.yml
95133
with:
96134
enabled: true
@@ -99,10 +137,32 @@ jobs:
99137
has_refs: ${{ needs.configure.outputs.has_refs }}
100138
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
101139
flavour: prod
140+
run_tests: true
102141
secrets:
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: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
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: ${{ secrets.DOCKERHUB_USERNAME }}
164+
# dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
165+
106166

107167
# -----------------------------------------------------------------------------------------------
108168
# (6/8) Build & Test work
@@ -122,10 +182,34 @@ jobs:
122182
has_refs: ${{ needs.configure.outputs.has_refs }}
123183
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
124184
flavour: work
185+
run_tests: true
125186
secrets:
126187
dockerhub_username: ""
127188
dockerhub_password: ""
128189

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+
129213

130214
# -----------------------------------------------------------------------------------------------
131215
# (7/8) Push images

.github/workflows/action_schedule_master.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,28 @@ jobs:
5656
has_refs: ${{ needs.configure.outputs.has_refs }}
5757
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
5858
flavour: base
59+
run_tests: true
5960
secrets:
6061
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
6162
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
6263

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

6482
# -----------------------------------------------------------------------------------------------
6583
# (4/8) Build & Test mods
@@ -70,6 +88,25 @@ jobs:
7088
- configure
7189
- base
7290
uses: ./.github/workflows/zzz-reuse-build.yml
91+
with:
92+
enabled: true
93+
can_deploy: true
94+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
95+
has_refs: ${{ needs.configure.outputs.has_refs }}
96+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
97+
flavour: mods
98+
run_tests: false
99+
secrets:
100+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
101+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
102+
103+
mods-test:
104+
needs:
105+
- params
106+
- configure
107+
- base
108+
- mods
109+
uses: ./.github/workflows/zzz-reuse-test.yml
73110
with:
74111
enabled: true
75112
can_deploy: true
@@ -91,6 +128,7 @@ jobs:
91128
- configure
92129
- base
93130
- mods
131+
- mods-test
94132
uses: ./.github/workflows/zzz-reuse-build.yml
95133
with:
96134
enabled: true
@@ -99,10 +137,32 @@ jobs:
99137
has_refs: ${{ needs.configure.outputs.has_refs }}
100138
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
101139
flavour: prod
140+
run_tests: true
102141
secrets:
103142
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
104143
dockerhub_password: ${{ secrets.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: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}
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: ${{ secrets.DOCKERHUB_USERNAME }}
164+
# dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
165+
106166

107167
# -----------------------------------------------------------------------------------------------
108168
# (6/8) Build & Test work
@@ -122,10 +182,34 @@ jobs:
122182
has_refs: ${{ needs.configure.outputs.has_refs }}
123183
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
124184
flavour: work
185+
run_tests: true
125186
secrets:
126187
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
127188
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
128189

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+
129213

130214
# -----------------------------------------------------------------------------------------------
131215
# (7/8) Push images

0 commit comments

Comments
 (0)