-
Notifications
You must be signed in to change notification settings - Fork 0
241 lines (233 loc) · 7.75 KB
/
work_proposal.yaml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
---
name: Work proposal
on:
merge_group:
branches:
- main
pull_request:
types: [opened, reopened]
branches:
- main
workflow_dispatch:
env:
IMAGE_NAME: stack/gear
jobs:
up-to-images:
name: Up to images (${{ matrix.env.dev }})
timeout-minutes: 10
permissions:
checks: write
packages: write
strategy:
fail-fast: false
matrix:
env:
- dev: godel
- dev: turing
- dev: church
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run ansible-playbook images.yaml
id: images
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--volume /var/run/docker.sock:/var/run/docker.sock
--volume ~/.docker/config.json:/root/.docker/config.json:ro
--env GITHUB_ACTOR=${{ github.actor }}
--env GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook images.yaml -v
-e devenv=${{ matrix.env.dev }}
-e repo_mode=rw
- uses: mikepenz/[email protected]
if: ${{ !cancelled() && (steps.images.outcome == 'success' || steps.images.outcome == 'failure') }}
with:
check_name: Unit test report (${{ matrix.env.dev }})
report_paths: "**/target/surefire-reports/TEST-*.xml"
require_tests: "${{ steps.images.outcome == 'failure' }}"
fail_on_failure: false
job_summary: false
- uses: mikepenz/[email protected]
if: ${{ !cancelled() && (steps.images.outcome == 'success' || steps.images.outcome == 'failure') }}
with:
check_name: Integration test report (${{ matrix.env.dev }})
report_paths: "**/target/failsafe-reports/TEST-*.xml"
require_tests: "${{ steps.images.outcome == 'failure' }}"
fail_on_failure: false
job_summary: false
stack-building:
name: Stack building (${{ matrix.env.dev }}, ${{ matrix.env.ops }})
timeout-minutes: 5
needs: [up-to-images]
strategy:
fail-fast: false
matrix:
purpose: [func]
env:
- dev: godel
ops: marx
- dev: turing
ops: durkheim
- dev: turing
ops: veblen
- dev: church
ops: commons
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run ansible-playbook stacks.yaml -t build
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume /var/run/docker.sock:/var/run/docker.sock
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t build
-e devenv=${{ matrix.env.dev }}
-e purpose=${{ matrix.purpose }}
-e opsenv=${{ matrix.env.ops }}
- uses: actions/[email protected]
with:
name: product-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/product/target/image-context
if-no-files-found: ignore
stack-checking:
name: Stack checking (${{ matrix.shard }}, ${{ matrix.purpose }}, ${{ matrix.env.ops }})
timeout-minutes: 15
needs: [stack-building]
strategy:
fail-fast: false
matrix:
purpose: [func]
shard: [0, 1]
env:
- dev: godel
ops: marx
- dev: turing
ops: durkheim
- dev: turing
ops: veblen
- dev: church
ops: commons
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: product-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/product/target/image-context
- name: Run ansible-playbook stacks.yaml -t check
run: >-
docker run --rm
--network gear
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--volume /var/run/docker.sock:/var/run/docker.sock
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t check
-e devenv=${{ matrix.env.dev }}
-e purpose=${{ matrix.purpose }}
-e opsenv=${{ matrix.env.ops }}
-e reminder=${{ matrix.shard }}
-e modulus=2
- uses: actions/[email protected]
if: ${{ !cancelled() }}
with:
name: e2e-test-report-${{ matrix.shard }}-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: test/e2e/target/surefire-reports/*.xml
if-no-files-found: ignore
stack-publishing:
name: Stack publishing (${{ matrix.purpose }}, ${{ matrix.env.ops }})
timeout-minutes: 10
needs: [stack-checking]
strategy:
fail-fast: false
matrix:
purpose: [func]
env:
- dev: godel
ops: marx
- dev: turing
ops: durkheim
- dev: turing
ops: veblen
- dev: church
ops: commons
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: product-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/product/target/image-context
- name: Run ansible-playbook stacks.yaml -t publish
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume /var/run/docker.sock:/var/run/docker.sock
--volume ~/.docker/config.json:/root/.docker/config.json:ro
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t publish -v
-e devenv=${{ matrix.env.dev }}
-e purpose=${{ matrix.purpose }}
-e opsenv=${{ matrix.env.ops }}
-e repo_mode=rw
stack-reporting:
name: Stack reporting
timeout-minutes: 5
needs: [stack-checking]
if: ${{ !cancelled() && (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/[email protected]
with:
path: artifacts
- uses: mikepenz/[email protected]
with:
check_name: E2E test report
report_paths: "artifacts/e2e-test-report-*/**/TEST-*.xml"
fail_on_failure: false
job_summary: false
everything-is-fine:
name: Everything is fine
needs: [stack-publishing, stack-reporting]
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ always() }}
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }}
run: |
echo "::error::Something went wrong"
exit 1