Skip to content

Commit 95b4765

Browse files
committed
Auto merge of rust-lang#2593 - RalfJung:ci, r=RalfJung
CI improvements - cache RTIM for the style checks - disable fail-fast for main checks so that we can see whether the other jobs are green
2 parents 23c02bc + 7a8b479 commit 95b4765

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

.github/workflows/ci.yml

+39-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
RUST_BACKTRACE: 1
2323
HOST_TARGET: ${{ matrix.host_target }}
2424
strategy:
25+
fail-fast: false
2526
matrix:
2627
build: [linux64, macos, win32]
2728
include:
@@ -89,11 +90,46 @@ jobs:
8990
runs-on: ubuntu-latest
9091
steps:
9192
- uses: actions/checkout@v3
92-
- name: Install required toolchain
93-
# We need a toolchain that can actually build Miri, just a nightly won't do.
93+
94+
# This is exactly duplicated from above. GHA is pretty terrible when it comes
95+
# to avoiding code duplication.
96+
97+
# Cache the global cargo directory, but NOT the local `target` directory which
98+
# we cannot reuse anyway when the nightly changes (and it grows quite large
99+
# over time).
100+
- name: Add cache for cargo
101+
id: cache
102+
uses: actions/cache@v3
103+
with:
104+
path: |
105+
# Taken from <https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci>.
106+
~/.cargo/bin
107+
~/.cargo/registry/index
108+
~/.cargo/registry/cache
109+
~/.cargo/git/db
110+
# contains package information of crates installed via `cargo install`.
111+
~/.cargo/.crates.toml
112+
~/.cargo/.crates2.json
113+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
114+
restore-keys: ${{ runner.os }}-cargo
115+
116+
- name: Install rustup-toolchain-install-master
117+
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
118+
shell: bash
119+
run: |
120+
cargo install -f rustup-toolchain-install-master
121+
122+
- name: Install "master" toolchain
123+
shell: bash
94124
run: |
95-
cargo install rustup-toolchain-install-master # TODO: cache this?
96125
./rustup-toolchain "" -c clippy
126+
127+
- name: Show Rust version
128+
run: |
129+
rustup show
130+
rustc -Vv
131+
cargo -V
132+
97133
- name: rustfmt
98134
run: ./miri fmt --check
99135
- name: clippy

0 commit comments

Comments
 (0)