Skip to content
Myr

CI: add use of Swatinem/rust-cache

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Miles Liu · committed by Miles Liu · parent f52eaa9 · Browse files · 1 file+14 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−2 removed

  • other:+14 added−2 removed

1 file+14 added−2 removed

modified:.github/workflows/CICD.yml+14 added-2 removed
24 unmodified lines
25 rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}26 rustup set profile minimal27 rustup toolchain install stable -c "clippy,rustfmt"28 rustup default stable29 - name: Rust cache30 uses: Swatinem/rust-cache@v231 - name: Ensure `cargo fmt` has been run32 run: cargo fmt --check33 - name: Ensure MSRV is set in `clippy.toml`34 run: grep "^msrv = \"${{ env.MIN_SUPPORTED_RUST_VERSION }}\"\$" clippy.toml
11 unmodified lines
46 run: |47 rustup set profile minimal48 rustup toolchain install ${{ env.MIN_SUPPORTED_RUST_VERSION }} -c clippy49 rustup default ${{ env.MIN_SUPPORTED_RUST_VERSION }}50 - name: Rust cache51 uses: Swatinem/rust-cache@v252 - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)53 run: cargo clippy --locked --all-targets --all-features54 - name: Run tests55 run: cargo test --locked
58 unmodified lines
114 run: |115 echo "CARGO_CMD=cargo" >> $GITHUB_ENV116 echo "CARGO_CMD=cargo" >> $Env:GITHUB_ENV117114 - name: Install cross118 - name: Set cargo cmd to cross119 if: ${{ matrix.job.use-cross == true }}120 run: |117 cargo install cross121 echo "CARGO_CMD=cross" >> $GITHUB_ENV122 echo "CARGO_CMD=cross" >> $Env:GITHUB_ENV123124 - name: Rust cache125 uses: Swatinem/rust-cache@v2126 with:127 key: ${{ matrix.job.os }}-${{ matrix.job.target }}128129 - name: Install cross130 if: ${{ matrix.job.use-cross == true }}131 run: cargo install cross132133 - name: Build134 run: ${{ env.CARGO_CMD }} build --locked --release --target=${{ matrix.job.target }}135136 - name: Strip debug information from executable
229 unmodified lines