run toolchain before cache

This commit is contained in:
GroovieGermanikus 2023-09-08 16:12:46 +02:00
parent d4b3cd5292
commit 2f7fe81d81
1 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set rust version
run: |
@ -32,6 +32,14 @@ jobs:
sudo apt-get update
sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev
# The toolchain action should definitely be run before the cache action
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_STABLE }}
components: rustfmt, clippy
# avoid the default "-D warnings"
rustflags: ""
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
- uses: actions/cache@v3
with:
@ -43,14 +51,6 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_STABLE }}
components: rustfmt, clippy
# avoid the default "-D warnings"
rustflags: ""
- name: Run fmt+clippy
run: |
cargo fmt --all --check