From e7ad4b6e20c42acedcb4013ce6164e6e43a925a7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 23 Jul 2023 00:25:43 +1000 Subject: [PATCH] Improve CI: Rm use of deprecated actions also: - use `taiki-e/install-action` to install any binary crates - use `Swatinem/rust-cache@v2` for caching - use `strategy` to avoid similar/duplicate jobs - pass `--no-deps` to `cargo-clippy` Signed-off-by: Jiahao XU --- .github/workflows/benchmarks.yml | 15 +- .github/workflows/ci.yml | 251 +++++------------------- .github/workflows/clippy.yml | 64 +++--- .github/workflows/cross_platform.yml | 279 +++++---------------------- .github/workflows/fuzz.yml | 40 ++-- .github/workflows/msrv.yml | 58 ++---- 6 files changed, 160 insertions(+), 547 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 8783c0c9..7c25ffe6 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -13,11 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: bench + + - name: Install toolchain + run: rustup toolchain install stable --no-self-update --profile minimal + - uses: Swatinem/rust-cache@v2 + + - name: Benchmark + run: cargo bench diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a83cb86d..3fce0952 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,78 +19,36 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable-check - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable - - uses: actions-rs/cargo@v1 - with: - command: check - args: --tests --all-features + + - name: Install toolchain + run: rustup toolchain install stable --no-self-update --profile minimal + - uses: Swatinem/rust-cache@v2 + + - name: Check + run: cargo check --tests --all-features test: + strategy: + fail-fast: false + matrix: + include: + - toolchain: stable + - toolchain: nightly + name: cargo test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable-test - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable - - name: Install cargo-nextest - uses: taiki-e/install-action@nextest - - name: cargo test - run: | - cargo nextest run --release --all-features --manifest-path=compact_str/Cargo.toml --run-ignored=all - test-nightly: - name: cargo test nightly - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-test - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly + - name: Install toolchain + run: | + rustup toolchain install ${{ matrix.toolchain }} --no-self-update --profile minimal + rustup override set ${{ matrix.toolchain }} - name: Install cargo-nextest uses: taiki-e/install-action@nextest - # Install nightly after cargo-nextest is installed, as cargo-nextest failed to compile on nightly - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true + + - uses: Swatinem/rust-cache@v2 + - name: cargo test run: | cargo nextest run --release --all-features --manifest-path=compact_str/Cargo.toml --run-ignored=all @@ -100,24 +58,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-test-miri - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-test - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly + + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal --component miri + rustup override set nightly + - uses: Swatinem/rust-cache@v2 + - name: Run Miri run: | cargo miri test --all-features --manifest-path=compact_str/Cargo.toml @@ -129,132 +76,36 @@ jobs: RUSTFLAGS: -Zrandomize-layout steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-test-randomize-layout - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-test - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly + + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal + rustup override set nightly + - uses: Swatinem/rust-cache@v2 + - name: Run Tests with Randomized Layout run: | cargo test --all-features --manifest-path=compact_str/Cargo.toml - example-bytes: + example: + strategy: + fail-fast: false + matrix: + include: + - path: bytes + - path: macros + - path: serde + - path: traits name: example - bytes runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example-bytes - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly - - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path examples/bytes/Cargo.toml - - example-macros: - name: example - macros - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example-macros - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly - - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path examples/macros/Cargo.toml - example-serde: - name: example - serde - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example-serde - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly - - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path examples/serde/Cargo.toml - - example-traits: - name: example - traits - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example-traits - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-example - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly - - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path examples/traits/Cargo.toml + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal + rustup override set nightly + - uses: Swatinem/rust-cache@v2 + - name: Run example-bytes + run: cargo run --manifest-path examples/${{ matrix.path }}/Cargo.toml diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 47982787..6e8dac35 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -18,20 +18,14 @@ jobs: steps: - uses: actions/checkout@v2 name: Checkout compact_str - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - profile: minimal - # We currently use some unstable features in rustfmt, hence the nightly toolchain - toolchain: nightly - override: true - - run: rustup component add rustfmt - name: Add rustfmt - - uses: actions-rs/cargo@v1 - name: Run rustfmt - with: - command: fmt - args: --all -- --check + + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal --component rustfmt + rustup override set nightly + + - name: Run rustfmt + run: cargo fmt --all -- --check clippy: name: cargo clippy @@ -39,18 +33,15 @@ jobs: steps: - uses: actions/checkout@v2 name: Checkout compact_str - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add clippy - name: Add clippy - - uses: actions-rs/cargo@v1 - name: Run clippy - with: - command: clippy + + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal --component clippy + rustup override set nightly + - uses: Swatinem/rust-cache@v2 + + - name: Run clippy + run: cargo clippy --no-deps doc: name: cargo doc @@ -60,15 +51,12 @@ jobs: steps: - uses: actions/checkout@v2 name: Checkout compact_str - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - profile: minimal - # docs.rs uses a nightly toolchain - toolchain: nightly - override: true - - uses: actions-rs/cargo@v1 - name: Run rustdoc - with: - command: doc - args: --all-features --no-deps --manifest-path compact_str/Cargo.toml + + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal + rustup override set nightly + - uses: Swatinem/rust-cache@v2 + + - name: Run rustdoc + run: cargo doc --all-features --no-deps --manifest-path compact_str/Cargo.toml diff --git a/.github/workflows/cross_platform.yml b/.github/workflows/cross_platform.yml index 09110f44..1c78c761 100644 --- a/.github/workflows/cross_platform.yml +++ b/.github/workflows/cross_platform.yml @@ -20,238 +20,57 @@ env: MIRIFAGS: "-Zmiri-tag-raw-pointers -Zmiri-check-number-validity" jobs: - windows: - name: Windows - runs-on: windows-latest + cross-test: + strategy: + fail-fast: false + matrix: + include: + - name: macos + OS: macos-latest + target: x86_64-apple-darwin + - name: Windows + OS: windows-latest + target: x86_64-pc-windows-msvc + - name: Linux 32-bit + OS: ubuntu-latest + target: i686-unknown-linux-gnu + cross: true + - name: Linux MIPS Big Endian 32-bit + OS: ubuntu-latest + target: mips-unknown-linux-gnu + cross: true + - name: Linux MIPS Little Endian 32-bit + OS: ubuntu-latest + target: mipsel-unknown-linux-gnu + cross: true + - name: Linux PowerPC Big Endian 32-bit + OS: ubuntu-latest + target: powerpc-unknown-linux-gnu + cross: true + - name: Linux PowerPC Little Endian 64-bit + OS: ubuntu-latest + target: powerpc64le-unknown-linux-gnu + cross: true + name: ${{ matrix.name }} + runs-on: ${{ matrix.OS }} steps: - uses: actions/checkout@v2 name: Checkout Repo - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - profile: minimal - toolchain: nightly - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-x-plat-windows-v3 - - uses: actions-rs/cargo@v1 - name: cargo test - with: - command: test - args: --release --all-features --manifest-path=compact_str/Cargo.toml -- --include-ignored - - uses: actions-rs/cargo@v1 - name: cargo test miri - with: - command: miri - args: test --all-features --manifest-path=compact_str/Cargo.toml - macos: - name: macOS - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - name: Checkout Repo - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - profile: minimal - toolchain: nightly - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-x-plat-macos-v3 - - uses: actions-rs/cargo@v1 - name: cargo test - with: - command: test - args: --release --all-features --manifest-path=compact_str/Cargo.toml -- --include-ignored - - uses: actions-rs/cargo@v1 - name: cargo test miri - with: - command: miri - args: test --all-features --manifest-path=compact_str/Cargo.toml - - linux_32bit: - name: Linux 32-bit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Checkout Repo - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - toolchain: nightly - target: i686-unknown-linux-gnu - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-x-plat-linux-32bit-v2 - - uses: actions-rs/cargo@v1 - name: cargo test - with: - use-cross: true - command: test - args: --release --all-features --manifest-path=compact_str/Cargo.toml --target i686-unknown-linux-gnu - - uses: actions-rs/cargo@v1 - name: cargo test miri - with: - command: miri - args: test --all-features --manifest-path=compact_str/Cargo.toml --target i686-unknown-linux-gnu - - linux_mips_32bit: - name: Linux MIPS Big Endian 32-bit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Checkout Repo - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - toolchain: nightly - target: mips-unknown-linux-gnu - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-x-plat-linux-mips-32bit-v2 - - uses: actions-rs/cargo@v1 - name: cargo test - with: - use-cross: true - command: test - args: --release --all-features --manifest-path=compact_str/Cargo.toml --target mips-unknown-linux-gnu - - uses: actions-rs/cargo@v1 - name: cargo test miri - with: - command: miri - args: test --all-features --manifest-path=compact_str/Cargo.toml --target mips-unknown-linux-gnu + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal --component miri --target ${{ matrix.target }} + rustup override set nightly + - name: Install cross + if: "matrix.cross" + uses: taiki-e/install-action@cross + - uses: Swatinem/rust-cache@v2 - linux_mips_le_32bit: - name: Linux MIPS Little Endian 32-bit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Checkout Repo - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - toolchain: nightly - target: mipsel-unknown-linux-gnu - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-x-plat-linux-mips-le-32bit-v2 - - uses: actions-rs/cargo@v1 - name: cargo test - with: - use-cross: true - command: test - args: --release --all-features --manifest-path=compact_str/Cargo.toml --target mipsel-unknown-linux-gnu - - uses: actions-rs/cargo@v1 - name: cargo test miri - with: - command: miri - args: test --all-features --manifest-path=compact_str/Cargo.toml --target mipsel-unknown-linux-gnu - - linux_powerpc_bit: - name: Linux PowerPC Big Endian 32-bit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Checkout Repo - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - toolchain: nightly - target: powerpc-unknown-linux-gnu - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-x-plat-linux-powerpc-32bit-v2 - - uses: actions-rs/cargo@v1 - name: cargo test - with: - use-cross: true - command: test - args: --release --all-features --manifest-path=compact_str/Cargo.toml --target powerpc-unknown-linux-gnu - - uses: actions-rs/cargo@v1 - name: cargo test miri - with: - command: miri - args: test --all-features --manifest-path=compact_str/Cargo.toml --target powerpc-unknown-linux-gnu - - linux_powerpc_le_64bit: - name: Linux PowerPC Little Endian 64-bit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Checkout Repo - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - toolchain: nightly - target: powerpc64le-unknown-linux-gnu - override: true - components: miri - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-x-plat-linux-powerpc-le-64bit-v2 - - uses: actions-rs/cargo@v1 - name: cargo test - with: - use-cross: true - command: test - args: --release --all-features --manifest-path=compact_str/Cargo.toml --target powerpc64le-unknown-linux-gnu - - uses: actions-rs/cargo@v1 - name: cargo test miri - with: - command: miri - args: test --all-features --manifest-path=compact_str/Cargo.toml --target powerpc64le-unknown-linux-gnu + - name: cargo test + if: "! matrix.cross" + run: cargo test --release --all-features --manifest-path=compact_str/Cargo.toml --target ${{ matrix.target }} -- --include-ignored + - name: cargo test + if: "matrix.cross" + run: cross test --release --all-features --manifest-path=compact_str/Cargo.toml --target ${{ matrix.target }} + - name: cargo test miri + run: cargo miri test --all-features --manifest-path=compact_str/Cargo.toml --target ${{ matrix.target }} diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 076d525f..59c88b5a 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -26,29 +26,18 @@ jobs: steps: - uses: actions/checkout@v2 name: Checkout compact_str - - uses: actions-rs/toolchain@v1 - name: Install Rust - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions-rs/install@v0.1 - name: Install cargo-fuzz - with: - crate: cargo-fuzz - version: latest - - uses: actions/cache@v3 + + - name: Install toolchain + run: | + rustup toolchain install nightly --no-self-update --profile minimal + rustup override set nightly + - name: Install cargo-fuzz + uses: taiki-e/install-action@v2 with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-fuzz-libfuzzer - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly-fuzz - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-nightly + tool: cargo-fuzz + - uses: Swatinem/rust-cache@v2 + + - name: Set Fuzz Time run: | if [[ "${{github.event_name}}" == "push" || "${{github.event_name}}" == "pull_request" ]]; then @@ -57,11 +46,8 @@ jobs: echo "fuzz_time=1800" >> $GITHUB_ENV fi echo "${{ env.fuzz_time }}" - - uses: actions-rs/cargo@v1 - name: Fuzz! - with: - command: fuzz - args: run --features=libfuzzer-sys --debug-assertions compact_str -- -max_total_time=${{ env.fuzz_time }} + - name: Fuzz! + run: cargo fuzz run --features=libfuzzer-sys --debug-assertions compact_str -- -max_total_time=${{ env.fuzz_time }} - name: File Issue (if failure found) if: failure() uses: JasonEtco/create-an-issue@v2.6 diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index b506604a..4b278fcf 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -22,32 +22,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - name: Toolchain Cache - uses: actions/cache@v3 - with: - path: | - ~/.rustup/downloads - ~/.rustup/toolchains - ~/.rustup/update-hashes - key: ${{ runner.os }}-x86_64-rustup - - name: Cargo Build Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable-cargo-hack - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable - - name: install cargo hack - run: cargo install cargo-hack --force + + - name: Install toolchain + run: rustup toolchain install stable --no-self-update --profile minimal + - name: Install cargo hack + uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + - name: cargo test msrv.. # note: we exclude both `arbitrary` and `proptest` from here because their MSRVs were both # bumped on a minor version release: @@ -65,24 +46,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - name: Cargo Build Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable-cargo-hack - restore-keys: | - ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-stable - - name: install cargo hack - run: cargo install cargo-hack --force + + - name: Install toolchain + run: rustup toolchain install stable --no-self-update --profile minimal + - name: Install cargo hack + uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + - name: cargo test msrv.. run: | cd compact_str