-
Notifications
You must be signed in to change notification settings - Fork 97
68 lines (55 loc) · 2.02 KB
/
ci-tool-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI - Clippy, Rustfmt, Rustdoc, & Tarpaulin
on: [pull_request, push]
jobs:
tools:
name: Clippy, Rustfmt, & Tarpaulin (Rust ${{ matrix.toolchain }} on ubuntu-latest)
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- 1.81.0
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust nightly toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install Rust toolchain
id: install-rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
# Tools-specific cache based on OS/compiler.
- name: Extract tools 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.cachekey }}
- name: Clippy
run: cargo clippy --all --tests -- -D warnings
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Rustdoc
run: cargo doc --all --no-deps
env:
RUSTDOCFLAGS: '-D warnings'
- name: Install cargo-binstall
if: ${{ success() && github.event_name == 'push' }}
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install tarpaulin
if: ${{ success() && github.event_name == 'push' }}
run: cargo binstall --no-confirm cargo-tarpaulin
- name: Run tarpaulin
if: ${{ success() && github.event_name == 'push' }}
run: cargo +nightly tarpaulin --verbose --timeout 120 --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v1.0.2
if: ${{ success() && github.event_name == 'push' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}