|
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 a Python |
5 |
| -# script located at src/ci/github-actions/calculate-job-matrix.py, 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 | 2 |
|
22 |
| -permissions: |
23 |
| - contents: read |
24 |
| - packages: write |
25 |
| - |
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-latest |
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: python3 src/ci/github-actions/calculate-job-matrix.py >> $GITHUB_OUTPUT |
60 |
| - id: jobs |
61 |
| - job: |
62 |
| - name: ${{ matrix.name }} |
63 |
| - needs: [ calculate_matrix ] |
64 |
| - runs-on: "${{ matrix.os }}" |
65 |
| - defaults: |
66 |
| - run: |
67 |
| - shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }} |
68 |
| - timeout-minutes: 240 |
69 |
| - env: |
70 |
| - CI_JOB_NAME: ${{ matrix.image }} |
71 |
| - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse |
72 |
| - # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs. |
73 |
| - HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} |
74 |
| - DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
75 |
| - SCCACHE_BUCKET: rust-lang-ci-sccache2 |
76 |
| - CACHE_DOMAIN: ci-caches.rust-lang.org |
77 |
| - continue-on-error: ${{ matrix.continue_on_error || false }} |
| 8 | + build: |
78 | 9 | strategy:
|
| 10 | + fail-fast: false |
79 | 11 | matrix:
|
80 |
| - # Check the `calculate_matrix` job to see how is the matrix defined. |
81 |
| - 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-2204 |
| 18 | + triple: x86_64-unknown-linux-gnu |
| 19 | + - os: buildjet-32vcpu-ubuntu-2204-arm |
| 20 | + triple: aarch64-unknown-linux-gnu |
| 21 | + runs-on: ${{ matrix.os }} |
82 | 22 | steps:
|
83 |
| - - if: contains(matrix.os, 'windows') |
84 |
| - |
| 23 | + - name: Install Rust |
| 24 | + uses: actions-rs/toolchain@v1 |
85 | 25 | with:
|
86 |
| - # i686 jobs use mingw32. x86_64 and cross-compile jobs use mingw64. |
87 |
| - msystem: ${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }} |
88 |
| - # don't try to download updates for already installed packages |
89 |
| - update: false |
90 |
| - # don't try to use the msys that comes built-in to the github runner, |
91 |
| - # so we can control what is installed (i.e. not python) |
92 |
| - release: true |
93 |
| - # Inherit the full path from the Windows environment, with MSYS2's */bin/ |
94 |
| - # dirs placed in front. This lets us run Windows-native Python etc. |
95 |
| - path-type: inherit |
96 |
| - install: > |
97 |
| - make |
| 26 | + toolchain: stable |
| 27 | + |
98 | 28 |
|
99 |
| - - name: disable git crlf conversion |
100 |
| - run: git config --global core.autocrlf false |
| 29 | + - name: Show rust version |
| 30 | + run: | |
| 31 | + cargo version |
| 32 | + rustup toolchain list |
101 | 33 |
|
102 |
| - - name: checkout the source code |
103 |
| - uses: actions/checkout@v4 |
| 34 | + - name: Check out succinctlabs/rust |
| 35 | + uses: actions/checkout@v3 |
104 | 36 | with:
|
105 |
| - fetch-depth: 2 |
106 |
| - |
107 |
| - # Rust Log Analyzer can't currently detect the PR number of a GitHub |
108 |
| - # Actions build on its own, so a hint in the log message is needed to |
109 |
| - # point it in the right direction. |
110 |
| - - name: configure the PR in which the error message will be posted |
111 |
| - run: echo "[CI_PR_NUMBER=$num]" |
112 |
| - env: |
113 |
| - num: ${{ github.event.number }} |
114 |
| - if: needs.calculate_matrix.outputs.run_type == 'pr' |
115 |
| - |
116 |
| - - name: add extra environment variables |
117 |
| - run: src/ci/scripts/setup-environment.sh |
118 |
| - env: |
119 |
| - # Since it's not possible to merge `${{ matrix.env }}` with the other |
120 |
| - # variables in `job.<name>.env`, the variables defined in the matrix |
121 |
| - # are passed to the `setup-environment.sh` script encoded in JSON, |
122 |
| - # which then uses log commands to actually set them. |
123 |
| - EXTRA_VARIABLES: ${{ toJson(matrix.env) }} |
124 |
| - |
125 |
| - - name: ensure the channel matches the target branch |
126 |
| - run: src/ci/scripts/verify-channel.sh |
127 |
| - |
128 |
| - - name: collect CPU statistics |
129 |
| - run: src/ci/scripts/collect-cpu-stats.sh |
130 |
| - |
131 |
| - - name: show the current environment |
132 |
| - run: src/ci/scripts/dump-environment.sh |
133 |
| - |
134 |
| - - name: install awscli |
135 |
| - run: src/ci/scripts/install-awscli.sh |
136 |
| - |
137 |
| - - name: install sccache |
138 |
| - run: src/ci/scripts/install-sccache.sh |
139 |
| - |
140 |
| - - name: select Xcode |
141 |
| - run: src/ci/scripts/select-xcode.sh |
142 |
| - |
143 |
| - - name: install clang |
144 |
| - run: src/ci/scripts/install-clang.sh |
| 37 | + submodules: "recursive" |
| 38 | + path: rust |
| 39 | + fetch-depth: 0 |
| 40 | + ref: ${{ github.ref }} |
145 | 41 |
|
146 |
| - - name: install tidy |
147 |
| - run: src/ci/scripts/install-tidy.sh |
148 |
| - |
149 |
| - - name: install WIX |
150 |
| - run: src/ci/scripts/install-wix.sh |
151 |
| - |
152 |
| - - name: disable git crlf conversion |
153 |
| - run: src/ci/scripts/disable-git-crlf-conversion.sh |
154 |
| - |
155 |
| - - name: checkout submodules |
156 |
| - run: src/ci/scripts/checkout-submodules.sh |
157 |
| - |
158 |
| - - name: install MinGW |
159 |
| - run: src/ci/scripts/install-mingw.sh |
160 |
| - |
161 |
| - - name: install ninja |
162 |
| - run: src/ci/scripts/install-ninja.sh |
163 |
| - |
164 |
| - - name: enable ipv6 on Docker |
165 |
| - run: src/ci/scripts/enable-docker-ipv6.sh |
166 |
| - |
167 |
| - # Disable automatic line ending conversion (again). On Windows, when we're |
168 |
| - # installing dependencies, something switches the git configuration directory or |
169 |
| - # re-enables autocrlf. We've not tracked down the exact cause -- and there may |
170 |
| - # be multiple -- but this should ensure submodules are checked out with the |
171 |
| - # appropriate line endings. |
172 |
| - - name: disable git crlf conversion |
173 |
| - run: src/ci/scripts/disable-git-crlf-conversion.sh |
174 |
| - |
175 |
| - - name: ensure line endings are correct |
176 |
| - run: src/ci/scripts/verify-line-endings.sh |
177 |
| - |
178 |
| - - name: ensure backported commits are in upstream branches |
179 |
| - run: src/ci/scripts/verify-backported-commits.sh |
180 |
| - |
181 |
| - - name: ensure the stable version number is correct |
182 |
| - run: src/ci/scripts/verify-stable-version-number.sh |
183 |
| - |
184 |
| - - name: run the build |
185 |
| - # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs. |
186 |
| - run: src/ci/scripts/run-build-from-ci.sh 2>&1 |
187 |
| - env: |
188 |
| - AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }} |
189 |
| - AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }} |
190 |
| - |
191 |
| - - name: create github artifacts |
192 |
| - run: src/ci/scripts/create-doc-artifacts.sh |
193 |
| - |
194 |
| - - name: upload artifacts to github |
195 |
| - uses: actions/upload-artifact@v4 |
| 42 | + - name: Check out succinctlabs/sp1 |
| 43 | + uses: actions/checkout@v3 |
196 | 44 | with:
|
197 |
| - # name is set in previous step |
198 |
| - name: ${{ env.DOC_ARTIFACT_NAME }} |
199 |
| - path: obj/artifacts/doc |
200 |
| - if-no-files-found: ignore |
201 |
| - retention-days: 5 |
| 45 | + repository: succinctlabs/sp1 |
| 46 | + ref: main |
| 47 | + path: sp1 |
202 | 48 |
|
203 |
| - - name: upload artifacts to S3 |
204 |
| - run: src/ci/scripts/upload-artifacts.sh |
205 |
| - env: |
206 |
| - AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }} |
207 |
| - AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }} |
208 |
| - # Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy |
209 |
| - # builders *should* have the AWS credentials available. Still, explicitly |
210 |
| - # adding the condition is helpful as this way CI will not silently skip |
211 |
| - # deploying artifacts from a dist builder if the variables are misconfigured, |
212 |
| - # erroring about invalid credentials instead. |
213 |
| - if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1' |
| 49 | + - name: Build |
| 50 | + run: | |
| 51 | + cd sp1/crates/cli |
| 52 | + GITHUB_ACTIONS=false SP1_BUILD_DIR=$GITHUB_WORKSPACE cargo run --bin cargo-prove -- prove build-toolchain |
214 | 53 |
|
215 |
| - # This job isused to tell bors the final status of the build, as there is no practical way to detect |
216 |
| - # when a workflow is successful listening to webhooks only in our current bors implementation (homu). |
217 |
| - outcome: |
218 |
| - name: bors build finished |
219 |
| - runs-on: ubuntu-latest |
220 |
| - needs: [ calculate_matrix, job ] |
221 |
| - # !cancelled() executes the job regardless of whether the previous jobs passed or failed |
222 |
| - if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }} |
223 |
| - steps: |
224 |
| - - name: checkout the source code |
225 |
| - uses: actions/checkout@v4 |
| 54 | + - name: Archive build output |
| 55 | + uses: actions/upload-artifact@v3 |
226 | 56 | with:
|
227 |
| - fetch-depth: 2 |
228 |
| - # Calculate the exit status of the whole CI workflow. |
229 |
| - # If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully). |
230 |
| - # If a some dependent job has failed, this exits with 1. |
231 |
| - - name: calculate the correct exit status |
232 |
| - run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}' |
233 |
| - # Publish the toolstate if an auto build succeeds (just before push to master) |
234 |
| - - name: publish toolstate |
235 |
| - run: src/ci/publish_toolstate.sh |
236 |
| - shell: bash |
237 |
| - if: needs.calculate_matrix.outputs.run_type == 'auto' |
238 |
| - env: |
239 |
| - TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues |
240 |
| - TOOLSTATE_PUBLISH: 1 |
| 57 | + name: rust-toolchain-${{ matrix.triple }} |
| 58 | + path: sp1/crates/cli/rust-toolchain-${{ matrix.triple }}.tar.gz |
0 commit comments