-
Notifications
You must be signed in to change notification settings - Fork 21
236 lines (224 loc) · 11.2 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
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
name: main
on:
pull_request:
push:
branches:
- main
jobs:
store-image-name-and-tags:
uses: ./.github/workflows/reuse-store-image-name-and-tags.yml
filter-commit-changes:
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Filter commit changes
outputs:
coordinator: ${{ steps.filter.outputs.coordinator }}
postman: ${{ steps.filter.outputs.postman }}
prover: ${{ steps.filter.outputs.prover }}
traces-api-facade: ${{ steps.filter.outputs.traces-api-facade }}
transaction-exclusion-api: ${{ steps.filter.outputs.transaction-exclusion-api }}
finalized-tag-updater: ${{ steps.filter.outputs.finalized-tag-updater }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Filter commit changes
uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
list-files: "json"
filters: |
coordinator:
- 'coordinator/**'
- 'testdata/**'
- 'buildSrc/**'
- 'jvm-libs/**'
- 'gradle/**'
- 'build.gradle'
- 'gradle.properties'
- 'settings.gradle'
- '.github/workflows/coordinator-*.yml'
- '.github/workflows/build-and-publish.yml'
- '.github/workflows/main.yml'
- '.github/workflows/reuse-*.yml'
- 'config/common/traces-limits-v1.toml'
- 'config/common/traces-limits-v2.toml'
- 'config/coordinator/**'
- 'e2e/**'
- 'docker/compose.yml'
- 'docker/compose-local-dev.overrides.yml'
- 'docker/compose-local-dev-traces-v2.overrides.yml'
postman:
- 'sdk/**'
- '.github/workflows/postman-*.yml'
- '.github/workflows/build-and-publish.yml'
- '.github/workflows/main.yml'
- '.github/workflows/reuse-*.yml'
prover:
- 'prover/**'
- '.github/workflows/prover-*.yml'
- '.github/workflows/build-and-publish.yml'
- '.github/workflows/main.yml'
- '.github/workflows/reuse-*.yml'
- 'constraints'
traces-api-facade:
- 'traces-api-facade/**'
- 'jvm-libs/linea/core/domain-models/**'
- 'jvm-libs/linea/core/traces/**'
- 'jvm-libs/linea/core/metrics/**'
- 'jvm-libs/generic/json-rpc/**'
- 'jvm-libs/generic/extensions/kotlin/**'
- 'jvm-libs/generic/extensions/futures/**'
- 'jvm-libs/generic/vertx-helper/**'
- 'jvm-libs/linea/metrics/**'
- 'config/common/traces-limits-v1.toml'
- '.github/workflows/traces-api-facade-*.yml'
- '.github/workflows/build-and-publish.yml'
- '.github/workflows/main.yml'
- '.github/workflows/reuse-*.yml'
- 'buildSrc/**'
- 'gradle/**'
- 'build.gradle'
- 'gradle.properties'
- 'settings.gradle'
transaction-exclusion-api:
- 'transaction-exclusion-api/**'
- 'jvm-libs/generic/extensions/futures/**'
- 'jvm-libs/generic/extensions/kotlin/**'
- 'jvm-libs/generic/json-rpc/**'
- 'jvm-libs/generic/persistence/**'
- 'jvm-libs/generic/vertx-helper/**'
- 'jvm-libs/linea/core/long-running-service/**'
- 'jvm-libs/linea/core/metrics/**'
- 'jvm-libs/linea/metrics/**'
- '.github/workflows/transaction-exclusion-api-*.yml'
- '.github/workflows/build-and-publish.yml'
- '.github/workflows/main.yml'
- '.github/workflows/reuse-*.yml'
- 'buildSrc/**'
- 'gradle/**'
- 'build.gradle'
- 'gradle.properties'
- 'settings.gradle'
finalized-tag-updater:
- 'jvm-libs/linea/core/long-running-service/**'
- 'jvm-libs/linea/web3j-extensions/**'
- 'jvm-libs/extensions/kotlin/**'
- 'jvm-libs/extensions/futures/**'
- 'finalized-tag-updater/**'
- '.github/workflows/main.yml'
- '.github/workflows/finalized-tag-updater-github-release.yml'
check-and-tag-images:
needs: [ store-image-name-and-tags, filter-commit-changes ]
uses: ./.github/workflows/reuse-check-images-tags-and-push.yml
with:
commit_tag: ${{ needs.store-image-name-and-tags.outputs.commit_tag }}
last_commit_tag: ${{ needs.store-image-name-and-tags.outputs.last_commit_tag }}
develop_tag: ${{ needs.store-image-name-and-tags.outputs.develop_tag }}
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator }}
postman_changed: ${{ needs.filter-commit-changes.outputs.postman }}
prover_changed: ${{ needs.filter-commit-changes.outputs.prover }}
traces_api_facade_changed: ${{ needs.filter-commit-changes.outputs.traces-api-facade }}
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api }}
secrets: inherit
manual-docker-build-and-e2e-tests:
runs-on: [self-hosted, ubuntu-20.04, X64, small]
needs: [ store-image-name-and-tags, filter-commit-changes, check-and-tag-images ]
environment: ${{ github.ref != 'refs/heads/main' && 'docker-build-and-e2e' || '' }}
concurrency:
group: manual-docker-build-and-e2e-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
steps:
- name: Deploy environment
run: |
echo "Build and e2e test environment deployed"
docker-build:
needs: [ store-image-name-and-tags, filter-commit-changes, check-and-tag-images, manual-docker-build-and-e2e-tests ]
uses: ./.github/workflows/build-and-publish.yml
with:
commit_tag: ${{ needs.store-image-name-and-tags.outputs.commit_tag }}
develop_tag: ${{ needs.store-image-name-and-tags.outputs.develop_tag }}
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator }}
postman_changed: ${{ needs.filter-commit-changes.outputs.postman }}
prover_changed: ${{ needs.filter-commit-changes.outputs.prover }}
traces_api_facade_changed: ${{ needs.filter-commit-changes.outputs.traces-api-facade }}
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api }}
coordinator_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_coordinator }}
postman_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_postman }}
prover_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_prover }}
traces_api_facade_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_traces_api_facade }}
transaction_exclusion_api_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_transaction_exclusion_api }}
secrets: inherit
# Comment out the auto build and release step below as the plugin release should be
# by manual Github action for versioning control
# finalized-tag-updater-jar-build-release:
# needs: [ filter-commit-changes ]
# if: ${{ always() && needs.filter-commit-changes.outputs.finalized-tag-updater == 'true' }}
# uses: ./.github/workflows/finalized-tag-updater-github-release.yml
# with:
# version: '0.0.1'
testing:
needs: [ store-image-name-and-tags, filter-commit-changes, check-and-tag-images ]
if: ${{ always() }}
uses: ./.github/workflows/testing.yml
with:
commit_tag: ${{ needs.store-image-name-and-tags.outputs.commit_tag }}
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator }}
postman_changed: ${{ needs.filter-commit-changes.outputs.postman }}
prover_changed: ${{ needs.filter-commit-changes.outputs.prover }}
traces_api_facade_changed: ${{ needs.filter-commit-changes.outputs.traces-api-facade }}
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api }}
secrets: inherit
run-e2e-tests-geth-tracing:
needs: [ store-image-name-and-tags, docker-build, manual-docker-build-and-e2e-tests ]
if: ${{ always() && needs.docker-build.result == 'success' }}
concurrency:
group: run-e2e-tests-geth-tracing-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
uses: ./.github/workflows/reuse-run-e2e-tests.yml
with:
commit_tag: ${{ needs.store-image-name-and-tags.outputs.commit_tag }}
tracing-engine: 'geth'
e2e-tests-logs-dump: true
secrets: inherit
run-e2e-tests:
needs: [ store-image-name-and-tags, docker-build, manual-docker-build-and-e2e-tests ]
if: ${{ always() && needs.docker-build.result == 'success' }}
concurrency:
group: run-e2e-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
uses: ./.github/workflows/reuse-run-e2e-tests.yml
with:
commit_tag: ${{ needs.store-image-name-and-tags.outputs.commit_tag }}
tracing-engine: 'besu'
e2e-tests-logs-dump: true
secrets: inherit
publish-images-after-run-tests-success-on-main:
needs: [ store-image-name-and-tags, testing, run-e2e-tests, run-e2e-tests-geth-tracing ]
if: ${{ always() && github.ref == 'refs/heads/main' && needs.testing.result == 'success' && needs.run-e2e-tests.outputs.tests_outcome == 'success' && needs.run-e2e-tests-geth-tracing.outputs.tests_outcome == 'success' }}
uses: ./.github/workflows/build-and-publish.yml
with:
push_image: true
commit_tag: ${{ needs.store-image-name-and-tags.outputs.commit_tag }}
develop_tag: ${{ needs.store-image-name-and-tags.outputs.develop_tag }}
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator }}
postman_changed: ${{ needs.filter-commit-changes.outputs.postman }}
prover_changed: ${{ needs.filter-commit-changes.outputs.prover }}
traces_api_facade_changed: ${{ needs.filter-commit-changes.outputs.traces-api-facade }}
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api }}
coordinator_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_coordinator }}
postman_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_postman }}
prover_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_prover }}
traces_api_facade_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_traces_api_facade }}
transaction_exclusion_api_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_transaction_exclusion_api }}
secrets: inherit
cleanup-deployments:
needs: [ run-e2e-tests, run-e2e-tests-geth-tracing ]
if: ${{ always() }}
runs-on: [self-hosted, ubuntu-20.04, X64, small]
steps:
- uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: docker-build-and-e2e
ref: ${{ github.ref_name }}
onlyRemoveDeployments: true