From a1bc9ad6ed3ad4adfa23927e780fc3998eea3b2e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 14 Oct 2022 09:45:40 +0200 Subject: [PATCH] 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 --- src/tools/miri/.github/workflows/ci.yml | 42 +++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/tools/miri/.github/workflows/ci.yml b/src/tools/miri/.github/workflows/ci.yml index 923f83913662..e6c6e8bf950b 100644 --- a/src/tools/miri/.github/workflows/ci.yml +++ b/src/tools/miri/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: RUST_BACKTRACE: 1 HOST_TARGET: ${{ matrix.host_target }} strategy: + fail-fast: false matrix: build: [linux64, macos, win32] include: @@ -89,11 +90,46 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install required toolchain - # We need a toolchain that can actually build Miri, just a nightly won't do. + + # This is exactly duplicated from above. GHA is pretty terrible when it comes + # to avoiding code duplication. + + # Cache the global cargo directory, but NOT the local `target` directory which + # we cannot reuse anyway when the nightly changes (and it grows quite large + # over time). + - name: Add cache for cargo + id: cache + uses: actions/cache@v3 + with: + path: | + # Taken from . + ~/.cargo/bin + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + # contains package information of crates installed via `cargo install`. + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo + + - name: Install rustup-toolchain-install-master + if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + shell: bash + run: | + cargo install -f rustup-toolchain-install-master + + - name: Install "master" toolchain + shell: bash run: | - cargo install rustup-toolchain-install-master # TODO: cache this? ./rustup-toolchain "" -c clippy + + - name: Show Rust version + run: | + rustup show + rustc -Vv + cargo -V + - name: rustfmt run: ./miri fmt --check - name: clippy