Skip to content

Commit

Permalink
use dtolnay/swatinem rust setup in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada committed Apr 6, 2024
1 parent 3831cc0 commit 19d23c4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 33 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/check-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: hecrj/setup-rust-action@v1
- uses: actions/cache@v3
- uses: dtolnay/rust-toolchain@master
with:
path: |
/usr/share/rust/.cargo/bin/mdbook
/usr/share/rust/.cargo/registry/index/
/usr/share/rust/.cargo/registry/cache/
/usr/share/rust/.cargo/git/db/
/usr/share/rust/.cargo/.crates.toml
/usr/share/rust/.cargo/.crates2.json
key: v4-mdbook-0.4
toolchain: stable
components: clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: "rust-cache-ubuntu"
- run: cargo install mdbook --vers "^0.4"
- run: mdbook build docs
- run: mdbook test docs
Expand Down
43 changes: 20 additions & 23 deletions .github/workflows/check-rust-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ jobs:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ ubuntu, windows, macOS ]
os: [ubuntu, windows, macOS]
steps:
- uses: actions/checkout@v2.4.0
- uses: hecrj/setup-rust-action@v1
- uses: actions/cache@v3
- uses: dtolnay/rust-toolchain@master
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: v2-build-and-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
toolchain: stable
components: clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: "rust-cache-${{ matrix.os }}"
# same checks as with `cargo build`, but no binaries are generated at the end, saving some time.
- run: cargo check --all-targets --all-features
- run: cargo test
Expand All @@ -30,27 +28,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: hecrj/setup-rust-action@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy rustfmt
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
rust-version: stable
components: rustfmt
key: "rust-cache-ubuntu"
- run: cargo fmt -- --check
check-lints:
name: Run linter on Rust code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: hecrj/setup-rust-action@v1
- uses: dtolnay/rust-toolchain@master
with:
rust-version: stable
toolchain: stable
components: clippy
- uses: actions/cache@v3
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: v2-check-lints-cargo-${{ hashFiles('**/Cargo.lock') }}
key: "rust-cache-ubuntu"
- run: cargo clippy --all-targets --all-features -- -D warnings

0 comments on commit 19d23c4

Please sign in to comment.