1
- # This file defines our primary CI workflow that runs on pull requests
2
- # and also on pushes to special branches (auto, try).
3
- #
4
- # The actual definition of the executed jobs is calculated by the
5
- # `src/ci/citool` crate, which
6
- # uses job definition data from src/ci/github-actions/jobs.yml.
7
- # You should primarily modify the `jobs.yml` file if you want to modify
8
- # what jobs are executed in CI.
9
-
10
1
name : CI
11
- on :
12
- push :
13
- branches :
14
- - auto
15
- - try
16
- - try-perf
17
- - automation/bors/try
18
- pull_request :
19
- branches :
20
- - " **"
21
-
22
- permissions :
23
- contents : read
24
- packages : write
25
2
26
- defaults :
27
- run :
28
- # On Linux, macOS, and Windows, use the system-provided bash as the default
29
- # shell. (This should only make a difference on Windows, where the default
30
- # shell is PowerShell.)
31
- shell : bash
3
+ on :
4
+ workflow_call :
5
+ workflow_dispatch :
32
6
33
- concurrency :
34
- # For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
35
- # We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
36
- # are all triggered on the same branch, but which should be able to run concurrently.
37
- group : ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}
38
- cancel-in-progress : true
39
- env :
40
- TOOLSTATE_REPO : " https://github.com/rust-lang-nursery/rust-toolstate"
41
- # This will be empty in PR jobs.
42
- TOOLSTATE_REPO_ACCESS_TOKEN : ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
43
7
jobs :
44
- # The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml.
45
- # It calculates which jobs should be executed, based on the data of the ${{ github }} context.
46
- # If you want to modify CI jobs, take a look at src/ci/github-actions/jobs.yml.
47
- calculate_matrix :
48
- name : Calculate job matrix
49
- runs-on : ubuntu-24.04
50
- outputs :
51
- jobs : ${{ steps.jobs.outputs.jobs }}
52
- run_type : ${{ steps.jobs.outputs.run_type }}
53
- steps :
54
- - name : Checkout the source code
55
- uses : actions/checkout@v4
56
- - name : Calculate the CI job matrix
57
- env :
58
- COMMIT_MESSAGE : ${{ github.event.head_commit.message }}
59
- run : |
60
- cd src/ci/citool
61
- CARGO_INCREMENTAL=0 cargo test
62
- CARGO_INCREMENTAL=0 cargo run calculate-job-matrix >> $GITHUB_OUTPUT
63
- id : jobs
64
- job :
65
- name : ${{ matrix.full_name }}
66
- needs : [ calculate_matrix ]
67
- runs-on : " ${{ matrix.os }}"
68
- timeout-minutes : 360
69
- env :
70
- CI_JOB_NAME : ${{ matrix.name }}
71
- CI_JOB_DOC_URL : ${{ matrix.doc_url }}
72
- GITHUB_WORKFLOW_RUN_ID : ${{ github.run_id }}
73
- GITHUB_REPOSITORY : ${{ github.repository }}
74
- CARGO_REGISTRIES_CRATES_IO_PROTOCOL : sparse
75
- # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
76
- HEAD_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
77
- DOCKER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78
- SCCACHE_BUCKET : rust-lang-ci-sccache2
79
- SCCACHE_REGION : us-west-1
80
- CACHE_DOMAIN : ci-caches.rust-lang.org
81
- continue-on-error : ${{ matrix.continue_on_error || false }}
8
+ build-buildjet :
82
9
strategy :
10
+ fail-fast : false
83
11
matrix :
84
- # Check the `calculate_matrix` job to see how is the matrix defined.
85
- include : ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
12
+ include :
13
+ - os : macos-14
14
+ triple : aarch64-apple-darwin
15
+ - os : macos-13
16
+ triple : x86_64-apple-darwin
17
+ - os : buildjet-32vcpu-ubuntu-2004
18
+ triple : x86_64-unknown-linux-gnu
19
+ runs-on : ${{ matrix.os }}
86
20
steps :
87
- - name : disable git crlf conversion
88
- run : git config --global core.autocrlf false
89
-
90
- - name : checkout the source code
91
- uses : actions/checkout@v4
21
+ - name : Install Rust
22
+ uses : actions-rs/toolchain@v1
92
23
with :
93
- fetch-depth : 2
94
-
95
- # Free up disk space on Linux by removing preinstalled components that
96
- # we do not need. We do this to enable some of the less resource
97
- # intensive jobs to run on free runners, which however also have
98
- # less disk space.
99
- - name : free up disk space
100
- run : src/ci/scripts/free-disk-space.sh
101
- if : matrix.free_disk
102
-
103
- # Rust Log Analyzer can't currently detect the PR number of a GitHub
104
- # Actions build on its own, so a hint in the log message is needed to
105
- # point it in the right direction.
106
- - name : configure the PR in which the error message will be posted
107
- run : echo "[CI_PR_NUMBER=$num]"
108
- env :
109
- num : ${{ github.event.number }}
110
- if : needs.calculate_matrix.outputs.run_type == 'pr'
111
-
112
- - name : add extra environment variables
113
- run : src/ci/scripts/setup-environment.sh
114
- env :
115
- # Since it's not possible to merge `${{ matrix.env }}` with the other
116
- # variables in `job.<name>.env`, the variables defined in the matrix
117
- # are passed to the `setup-environment.sh` script encoded in JSON,
118
- # which then uses log commands to actually set them.
119
- EXTRA_VARIABLES : ${{ toJson(matrix.env) }}
120
-
121
- - name : setup upstream remote
122
- run : src/ci/scripts/setup-upstream-remote.sh
123
-
124
- - name : ensure the channel matches the target branch
125
- run : src/ci/scripts/verify-channel.sh
126
-
127
- - name : collect CPU statistics
128
- run : src/ci/scripts/collect-cpu-stats.sh
129
-
130
- - name : show the current environment
131
- run : src/ci/scripts/dump-environment.sh
132
-
133
- - name : install awscli
134
- run : src/ci/scripts/install-awscli.sh
135
-
136
- - name : install sccache
137
- run : src/ci/scripts/install-sccache.sh
138
-
139
- - name : select Xcode
140
- run : src/ci/scripts/select-xcode.sh
141
-
142
- - name : install clang
143
- run : src/ci/scripts/install-clang.sh
144
-
145
- - name : install tidy
146
- run : src/ci/scripts/install-tidy.sh
147
-
148
- - name : install WIX
149
- run : src/ci/scripts/install-wix.sh
150
-
151
- - name : disable git crlf conversion
152
- run : src/ci/scripts/disable-git-crlf-conversion.sh
153
-
154
- - name : checkout submodules
155
- run : src/ci/scripts/checkout-submodules.sh
24
+ toolchain : 1.87.0
25
+ - uses : lukka/get-cmake@v3.27.4
156
26
157
- - name : install MinGW
158
- run : src/ci/scripts/install-mingw.sh
159
-
160
- - name : install ninja
161
- run : src/ci/scripts/install-ninja.sh
162
-
163
- - name : enable ipv6 on Docker
164
- run : src/ci/scripts/enable-docker-ipv6.sh
165
-
166
- # Disable automatic line ending conversion (again). On Windows, when we're
167
- # installing dependencies, something switches the git configuration directory or
168
- # re-enables autocrlf. We've not tracked down the exact cause -- and there may
169
- # be multiple -- but this should ensure submodules are checked out with the
170
- # appropriate line endings.
171
- - name : disable git crlf conversion
172
- run : src/ci/scripts/disable-git-crlf-conversion.sh
173
-
174
- - name : ensure line endings are correct
175
- run : src/ci/scripts/verify-line-endings.sh
176
-
177
- - name : ensure backported commits are in upstream branches
178
- run : src/ci/scripts/verify-backported-commits.sh
179
-
180
- - name : ensure the stable version number is correct
181
- run : src/ci/scripts/verify-stable-version-number.sh
182
-
183
- # Show the environment just before we run the build
184
- # This makes it easier to diagnose problems with the above install scripts.
185
- - name : show the current environment
186
- run : src/ci/scripts/dump-environment.sh
187
-
188
- # Pre-build citool before the following step uninstalls rustup
189
- # Build it into the build directory, to avoid modifying sources
190
- - name : build citool
191
- run : |
192
- cd src/ci/citool
193
- CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
27
+ - name : Install Go
28
+ uses : actions/setup-go@v4
29
+ with :
30
+ go-version : 1.21.4
31
+ check-latest : true
194
32
195
- - name : run the build
33
+ - name : Show rust version
196
34
run : |
197
- set +e
198
- # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
199
- src/ci/scripts/run-build-from-ci.sh 2>&1
200
- STATUS=$?
201
- set -e
35
+ cargo version
36
+ rustup toolchain list
202
37
203
- if [[ "$STATUS" -ne 0 && -n "$CI_JOB_DOC_URL" ]]; then
204
- echo "****************************************************************************"
205
- echo "To find more information about this job, visit the following URL:"
206
- echo "$CI_JOB_DOC_URL"
207
- echo "****************************************************************************"
208
- fi
209
- exit ${STATUS}
210
- env :
211
- AWS_ACCESS_KEY_ID : ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
212
- AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
38
+ - name : Check out succinctlabs/rust
39
+ uses : actions/checkout@v3
40
+ with :
41
+ submodules : " recursive"
42
+ path : rust
43
+ fetch-depth : 0
44
+ ref : ${{ github.ref }}
213
45
214
- - name : create github artifacts
215
- run : src/ci/scripts/create-doc-artifacts.sh
46
+ - name : Check out succinctlabs/sp1
47
+ uses : actions/checkout@v3
48
+ with :
49
+ repository : succinctlabs/sp1
50
+ ref : dev
51
+ path : sp1
216
52
217
- - name : print disk usage
53
+ - name : Build
218
54
run : |
219
- echo "disk usage:"
220
- df -h
55
+ cd sp1/crates/cli
56
+ GITHUB_ACTIONS=false SP1_BUILD_DIR=$GITHUB_WORKSPACE cargo run --bin cargo-prove -- prove build-toolchain
221
57
222
- - name : upload artifacts to github
58
+ - name : Archive build output
223
59
uses : actions/upload-artifact@v4
224
60
with :
225
- # name is set in previous step
226
- name : ${{ env.DOC_ARTIFACT_NAME }}
227
- path : obj/artifacts/doc
228
- if-no-files-found : ignore
229
- retention-days : 5
61
+ name : rust-toolchain-${{ matrix.triple }}
62
+ path : sp1/crates/cli/rust-toolchain-${{ matrix.triple }}.tar.gz
63
+
64
+ build-runs-on :
65
+ strategy :
66
+ fail-fast : false
67
+ runs-on : [runs-on, runner=32cpu-linux-arm64, image=ubuntu22-full-arm64, "run-id=${{ github.run_id }}"]
68
+ steps :
69
+ - name : Install Rust
70
+ uses : actions-rs/toolchain@v1
71
+ with :
72
+ toolchain : 1.87.0
73
+ - uses : lukka/get-cmake@v3.27.4
230
74
231
- - name : upload artifacts to S3
232
- run : src/ci/scripts/upload-artifacts.sh
233
- env :
234
- AWS_ACCESS_KEY_ID : ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
235
- AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
236
- # Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
237
- # builders *should* have the AWS credentials available. Still, explicitly
238
- # adding the condition is helpful as this way CI will not silently skip
239
- # deploying artifacts from a dist builder if the variables are misconfigured,
240
- # erroring about invalid credentials instead.
241
- if : github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
75
+ - name : Install Go
76
+ uses : actions/setup-go@v4
77
+ with :
78
+ go-version : 1.21.4
79
+ check-latest : true
242
80
243
- - name : postprocess metrics into the summary
244
- # This step is not critical, and if some I/O problem happens, we don't want
245
- # to cancel the build.
246
- continue-on-error : true
81
+ - name : Show rust version
247
82
run : |
248
- if [ -f build/metrics.json ]; then
249
- METRICS=build/metrics.json
250
- elif [ -f obj/build/metrics.json ]; then
251
- METRICS=obj/build/metrics.json
252
- else
253
- echo "No metrics.json found"
254
- exit 0
255
- fi
83
+ cargo version
84
+ rustup toolchain list
256
85
257
- # Get closest bors merge commit
258
- PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
86
+ - name : Check out succinctlabs/rust
87
+ uses : actions/checkout@v3
88
+ with :
89
+ submodules : " recursive"
90
+ path : rust
91
+ fetch-depth : 0
92
+ ref : ${{ github.ref }}
259
93
260
- ./build/citool/debug/citool postprocess-metrics \
261
- --job-name ${CI_JOB_NAME} \
262
- --parent ${PARENT_COMMIT} \
263
- ${METRICS} >> ${GITHUB_STEP_SUMMARY}
94
+ - name : Check out succinctlabs/sp1
95
+ uses : actions/checkout@v3
96
+ with :
97
+ repository : succinctlabs/sp1
98
+ ref : dev
99
+ path : sp1
264
100
265
- - name : upload job metrics to DataDog
266
- # This step is not critical, and if some I/O problem happens, we don't want
267
- # to cancel the build.
268
- continue-on-error : true
269
- if : needs.calculate_matrix.outputs.run_type != 'pr'
270
- env :
271
- DATADOG_API_KEY : ${{ secrets.DATADOG_API_KEY }}
272
- DD_GITHUB_JOB_NAME : ${{ matrix.full_name }}
273
- run : ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv
101
+ - name : Build
102
+ run : |
103
+ cd sp1/crates/cli
104
+ GITHUB_ACTIONS=false SP1_BUILD_DIR=$GITHUB_WORKSPACE cargo run --bin cargo-prove -- prove build-toolchain
274
105
275
- # This job isused to tell bors the final status of the build, as there is no practical way to detect
276
- # when a workflow is successful listening to webhooks only in our current bors implementation (homu).
277
- outcome :
278
- name : bors build finished
279
- runs-on : ubuntu-24.04
280
- needs : [ calculate_matrix, job ]
281
- # !cancelled() executes the job regardless of whether the previous jobs passed or failed
282
- if : ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
283
- steps :
284
- - name : checkout the source code
285
- uses : actions/checkout@v4
106
+ - name : Archive build output
107
+ uses : actions/upload-artifact@v4
286
108
with :
287
- fetch-depth : 2
288
- # Calculate the exit status of the whole CI workflow.
289
- # If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully).
290
- # If a some dependent job has failed, this exits with 1.
291
- - name : calculate the correct exit status
292
- run : jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
293
- # Publish the toolstate if an auto build succeeds (just before push to master)
294
- - name : publish toolstate
295
- run : src/ci/publish_toolstate.sh
296
- shell : bash
297
- if : needs.calculate_matrix.outputs.run_type == 'auto'
298
- env :
299
- TOOLSTATE_ISSUES_API_URL : https://api.github.com/repos/rust-lang/rust/issues
300
- TOOLSTATE_PUBLISH : 1
109
+ name : rust-toolchain-aarch64-unknown-linux-gnu
110
+ path : sp1/crates/cli/rust-toolchain-aarch64-unknown-linux-gnu.tar.gz
0 commit comments