|
22 | 22 | RUST_BACKTRACE: 1
|
23 | 23 | HOST_TARGET: ${{ matrix.host_target }}
|
24 | 24 | strategy:
|
| 25 | + fail-fast: false |
25 | 26 | matrix:
|
26 | 27 | build: [linux64, macos, win32]
|
27 | 28 | include:
|
@@ -89,11 +90,46 @@ jobs:
|
89 | 90 | runs-on: ubuntu-latest
|
90 | 91 | steps:
|
91 | 92 | - 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 |
94 | 124 | run: |
|
95 |
| - cargo install rustup-toolchain-install-master # TODO: cache this? |
96 | 125 | ./rustup-toolchain "" -c clippy
|
| 126 | +
|
| 127 | + - name: Show Rust version |
| 128 | + run: | |
| 129 | + rustup show |
| 130 | + rustc -Vv |
| 131 | + cargo -V |
| 132 | +
|
97 | 133 | - name: rustfmt
|
98 | 134 | run: ./miri fmt --check
|
99 | 135 | - name: clippy
|
|
0 commit comments