-
Notifications
You must be signed in to change notification settings - Fork 0
244 lines (236 loc) · 7.89 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
242
243
244
---
name: Work proposal
on:
pull_request:
branches: [main]
types:
- opened
- reopened
- ready_for_review
merge_group:
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)/orchestrator/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 tests (${{ 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 tests (${{ 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.ops }}, ${{ matrix.ility }})
timeout-minutes: 10
needs: [up-to-images]
strategy:
fail-fast: false
matrix:
ility: [programmability, resilience]
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)/orchestrator/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t build -v
-e devenv=${{ matrix.env.dev }}
-e ility=${{ matrix.ility }}
-e opsenv=${{ matrix.env.ops }}
-e repo_mode=ro
- uses: actions/[email protected]
with:
name: product-${{ matrix.env.ops }}-${{ matrix.ility }}
path: stack/product/target/${{ matrix.ility }}
if-no-files-found: ignore
stack-checking:
name: Stack checking (${{ matrix.env.ops }}, ${{ matrix.ility }}, ${{ matrix.shard }})
timeout-minutes: 15
needs: [stack-building]
strategy:
fail-fast: false
matrix:
ility: [programmability, resilience]
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.env.ops }}-${{ matrix.ility }}
path: stack/product/target/${{ matrix.ility }}
- 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)/orchestrator/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t check -v
-e devenv=${{ matrix.env.dev }}
-e ility=${{ matrix.ility }}
-e opsenv=${{ matrix.env.ops }}
-e reminder=${{ matrix.shard }}
-e modulus=2
-e repo_mode=ro
- uses: actions/[email protected]
if: ${{ !cancelled() }}
with:
name: e2e-tests-${{ matrix.env.ops }}-${{ matrix.ility }}-${{ matrix.shard }}
path: test/e2e/target/surefire-reports/*.xml
if-no-files-found: ignore
stack-publishing:
name: Stack publishing (${{ matrix.env.ops }}, ${{ matrix.ility }})
timeout-minutes: 10
needs: [stack-checking]
strategy:
fail-fast: false
matrix:
ility: [programmability, resilience]
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.env.ops }}-${{ matrix.ility }}
path: stack/product/target/${{ matrix.ility }}
- 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)/orchestrator/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t publish -v
-e devenv=${{ matrix.env.dev }}
-e ility=${{ matrix.ility }}
-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: End-to-end tests
report_paths: "artifacts/e2e-tests-*/**/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