Skip to content

Commit

Permalink
chore: add caching to CI, use new toolchain action and remove actions…
Browse files Browse the repository at this point in the history
…-rs/cargo

actions-rs actions are archived and no longer maintained.
  • Loading branch information
kahlstrm committed Mar 15, 2024
1 parent 00c24cd commit 9686296
Showing 1 changed file with 20 additions and 35 deletions.
55 changes: 20 additions & 35 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: check
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Run cargo check
run: cargo check

test:
name: Test Suite
Expand All @@ -37,12 +33,9 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Install Diesel
run: cargo install diesel_cli --features=postgres
- name: Create Test DB
Expand All @@ -59,30 +52,22 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
command: clippy
args: -- -D warnings
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
run: cargo clippy -- -D warnings

0 comments on commit 9686296

Please sign in to comment.