forked from matter-labs/zksync-era
-
Notifications
You must be signed in to change notification settings - Fork 1
199 lines (183 loc) · 8.07 KB
/
ci.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
name: CI
on:
pull_request:
merge_group:
push:
branches:
- staging
- trying
- '!release-please--branches--**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changed_files:
runs-on: ubuntu-latest
name: Get changed files
outputs:
core: ${{ steps.changed-files.outputs.core_any_changed }}
prover: ${{ steps.changed-files.outputs.prover_any_changed }}
zk_toolbox: ${{ steps.changed-files.outputs.zk_toolbox_any_changed }}
docs: ${{ steps.changed-files.outputs.docs_any_changed }}
all: ${{ steps.changed-files.outputs.all_any_changed }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
fetch-depth: 2
submodules: "recursive"
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@fea790cb660e33aef4bdf07304e28fedd77dfa13 # v39
with:
files_yaml: |
prover:
- 'prover/**'
- '!prover/CHANGELOG.md'
- '!prover/setup-data-cpu-keys.json'
- '!prover/setup-data-gpu-keys.json'
- '!prover/extract-setup-data-keys.sh'
- 'docker/prover*/**'
- '.github/workflows/build-prover-template.yml'
- '.github/workflows/ci-prover-reusable.yml'
- 'docker-compose-runner-nightly.yml'
- '!**/*.md'
- '!**/*.MD'
core:
- 'core/**'
- '!core/CHANGELOG.md'
- 'docker/contract-verifier/**'
- 'docker/external-node/**'
- 'docker/server/**'
- '.github/workflows/build-core-template.yml'
- '.github/workflows/build-contract-verifier-template.yml'
- '.github/workflows/ci-core-reusable.yml'
- '.github/workflows/ci-core-lint-reusable.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- '!**/*.md'
- '!**/*.MD'
- 'docker-compose.yml'
zk_toolbox:
- '.github/workflows/ci-zk-toolbox-reusable.yml'
- 'zk_toolbox/**'
- '!**/*.md'
- '!**/*.MD'
docs:
- '**/*.md'
- '**/*.MD'
- '.github/workflows/ci-docs-reusable.yml'
all:
- '.github/workflows/ci.yml'
- 'bin/**'
- 'etc/**'
- 'contracts/**'
- 'infrastructure/zk/**'
- 'docker/zk-environment/**'
- '!**/*.md'
- '!**/*.MD'
ci-for-core-lint:
name: CI for Core lint Components
needs: changed_files
if: contains(github.ref_name, 'release-please--branches')
uses: ./.github/workflows/ci-core-lint-reusable.yml
ci-for-core:
name: CI for Core Components
needs: changed_files
if: ${{ (needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
uses: ./.github/workflows/ci-core-reusable.yml
ci-for-prover:
needs: changed_files
if: ${{ (needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
name: CI for Prover Components
uses: ./.github/workflows/ci-prover-reusable.yml
ci-for-zk-toolbox:
needs: changed_files
if: ${{ (needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.zk_toolbox == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
name: CI for zk_toolbox
uses: ./.github/workflows/ci-zk-toolbox-reusable.yml
ci-for-docs:
needs: changed_files
if: needs.changed_files.outputs.docs == 'true'
name: CI for Docs
uses: ./.github/workflows/ci-docs-reusable.yml
# What needs to be ran for both core and prover
ci-for-common:
needs: changed_files
if: ${{ (needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
name: CI for Common Components (prover or core)
uses: ./.github/workflows/ci-common-reusable.yml
build-core-images:
name: Build core images
needs: changed_files
if: ${{ (needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
uses: ./.github/workflows/build-core-template.yml
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
action: "build"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
build-tee-prover-images:
name: Build TEE Prover images
needs: changed_files
if: ${{ (needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
uses: ./.github/workflows/build-tee-prover-template.yml
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
action: "build"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
build-contract-verifier:
name: Build contract verifier
needs: changed_files
if: ${{ (needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
uses: ./.github/workflows/build-contract-verifier-template.yml
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
action: "build"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
build-prover-images:
name: Build prover images
needs: changed_files
if: ${{ (needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
uses: ./.github/workflows/build-prover-template.yml
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
action: "build"
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
is_pr_from_fork: ${{ github.event.pull_request.head.repo.fork == true }}
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
build-witness-generator-image-avx512:
name: Build prover images with avx512 instructions
needs: changed_files
if: ${{ (needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
uses: ./.github/workflows/build-witness-generator-template.yml
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}-avx512
action: "build"
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
is_pr_from_fork: ${{ github.event.pull_request.head.repo.fork == true }}
WITNESS_GENERATOR_RUST_FLAGS: "-Ctarget_feature=+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512vl"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
ci-success:
name: Github Status Check
runs-on: ubuntu-latest
if: always() && !cancelled()
needs: [ci-for-core-lint, ci-for-common, ci-for-core, ci-for-prover, ci-for-docs, build-core-images, build-contract-verifier, build-prover-images]
steps:
- name: Status
run: |
# This will check all jobs status in the `needs` list, and fail job if one is failed.
# Since we split prover and core to different flows, this job will be only as Required Status Check in the Pull Request.
if [[ ${{ contains(join(needs.*.result, ','), 'failure') }} == "true" ]]; then
echo "Intentionally failing to block PR from merging"
exit 1
fi