Skip to content

Commit 5c23203

Browse files
committed
CI: test bootstrap build
1 parent f3427c5 commit 5c23203

File tree

1 file changed

+37
-2
lines changed
  • src/tools/miri/.github/workflows

1 file changed

+37
-2
lines changed

src/tools/miri/.github/workflows/ci.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,41 @@ jobs:
117117
- name: rustdoc
118118
run: RUSTDOCFLAGS="-Dwarnings" ./miri doc --document-private-items
119119

120+
bootstrap:
121+
name: bootstrap build
122+
runs-on: ubuntu-latest
123+
steps:
124+
- uses: actions/checkout@v4
125+
# Deliberately skipping `./.github/workflows/setup` as we do our own setup
126+
- name: Add cache for cargo
127+
id: cache
128+
uses: actions/cache@v4
129+
with:
130+
path: |
131+
# Taken from <https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci>.
132+
# Cache package/registry information
133+
~/.cargo/registry/index
134+
~/.cargo/registry/cache
135+
~/.cargo/git/db
136+
# Cache bootstrap downloads
137+
../rust/build/cache
138+
key: cargo-bootstrap-${{ hashFiles('rust-version') }}
139+
restore-keys: cargo-bootstrap
140+
- name: prepare build environment
141+
run: |
142+
MIRIDIR=$(pwd)
143+
cd ..
144+
# Bootstrap needs at least depth 2 to function.
145+
git clone https://github.com/rust-lang/rust/ rust --depth 2 --revision $(cat "$MIRIDIR/rust-version")
146+
cd rust
147+
# Replace the in-tree Miri with the current version.
148+
rm src/tools/miri -rf
149+
ln -s "$MIRIDIR" src/tools/miri
150+
- name: check build
151+
run: |
152+
cd ../rust # ./x does not seem to like being invoked from elsewhere
153+
./x check miri
154+
120155
coverage:
121156
name: coverage report
122157
runs-on: ubuntu-latest
@@ -130,7 +165,7 @@ jobs:
130165
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
131166
# And they should be added below in `cron-fail-notify` as well.
132167
conclusion:
133-
needs: [test, style, coverage]
168+
needs: [test, style, bootstrap, coverage]
134169
# We need to ensure this job does *not* get skipped if its dependencies fail,
135170
# because a skipped job is considered a success by GitHub. So we have to
136171
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -211,7 +246,7 @@ jobs:
211246
cron-fail-notify:
212247
name: cronjob failure notification
213248
runs-on: ubuntu-latest
214-
needs: [test, style, coverage]
249+
needs: [test, style, bootstrap, coverage]
215250
if: ${{ github.event_name == 'schedule' && failure() }}
216251
steps:
217252
# Send a Zulip notification

0 commit comments

Comments
 (0)