generated from hack-ink/rust-initializer
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (54 loc) · 1.58 KB
/
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
name: Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CACHE_VERSION: 0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUST_BACKTRACE: full
jobs:
cargo-checks:
name: Task cargo ${{ matrix.action }}
runs-on: ubuntu-latest
strategy:
matrix:
action: [clippy, fmt, nextest]
steps:
- name: Fetch latest code
uses: actions/checkout@v4
- name: Setup build environment
if: matrix.action != 'fmt'
run: rustup show
- uses: Swatinem/rust-cache@v2
if: matrix.action != 'fmt'
with:
prefix-key: ${{ env.CACHE_VERSION }}
key: ${{ matrix.action }}
- name: Cargo clippy
if: matrix.action == 'clippy'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features --all-targets --locked
- name: Cargo fmt
if: matrix.action == 'fmt'
run: cargo fmt --all -- --check
- name: Install cargo-nextest
if: matrix.action == 'nextest'
uses: taiki-e/install-action@nextest
- name: Cargo nextest
if: matrix.action == 'nextest'
run: cargo nextest run --cargo-profile ci-dev --workspace --all-features --all-targets --locked
- name: Fast fail
uses: vishnudxb/cancel-workflow@v1.2
if: failure()
with:
repo: hack-ink/cargo-all
workflow_id: ${{ github.run_id }}
access_token: ${{ github.token }}