Repository navigation
82 lines (67 loc) · 2.14 KB
/
Copy pathrust.yml
File metadata and controls
82 lines (67 loc) · 2.14 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Rust
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
concurrency:
group: rust-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo
# Pinned to the Swatinem/rust-cache v2.9.2 release commit.
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6
with:
key: clippy
# Only write the cache from the default branch so PR runs share a
# clean baseline and don't churn the cache (keeps it under the 10 GB cap).
save-if: ${{ github.ref == 'refs/heads/master' }}
cache-bin: false
- name: Run clippy
run: cargo clippy --workspace --all-targets -- -D warnings
build-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
# Pinned to the Swatinem/rust-cache v2.9.2 release commit.
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6
with:
key: build-test
# Only write the cache from the default branch so PR runs share a
# clean baseline and don't churn the cache (keeps it under the 10 GB cap).
save-if: ${{ github.ref == 'refs/heads/master' }}
cache-bin: false
- name: Build
run: cargo build --workspace --verbose
- name: Test
run: cargo test --workspace --verbose