Skip to content

Commit

Permalink
Update the github workflow
Browse files Browse the repository at this point in the history
Update the github workflow with newer tooling and improved caching
  • Loading branch information
electronjoe authored Nov 3, 2024
2 parents de4c2fd + 1db34d9 commit 369b4bb
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions .github/workflows/ci-tool-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,50 @@ jobs:
strategy:
matrix:
toolchain:
- 1.54.0
- stable

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy

# Tools-specific cache based on OS/compiler.
- name: Extract tools cache
uses: actions/cache@v2
- name: Setup cache
uses: actions/cache@v4
with:
path: |
~/.cargo
!~/.cargo/registry/index
!~/.cargo/git/checkouts
target
!target/tests
!target/examples
key: tools-${{ runner.os }}-${{ steps.install-rust.outputs.rustc_hash }}
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}

- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --tests -- -D warnings
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Rustdoc
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps
env:
RUSTDOCFLAGS: '-D warnings'
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --all --no-deps

- name: Install cargo-tarpaulin
if: github.event_name == 'push'
run: cargo install cargo-tarpaulin

- name: Run tarpaulin
uses: actions-rs/[email protected]
if: ${{ success() && github.event_name == 'push' }}
if: github.event_name == 'push'
run: cargo tarpaulin --out xml

- name: Upload to codecov.io
uses: codecov/[email protected]
if: ${{ success() && github.event_name == 'push' }}
if: github.event_name == 'push'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 369b4bb

Please sign in to comment.