-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (56 loc) · 1.59 KB
/
rust.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
name: rust
on:
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Lint
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
- name: Install cargo check tools
run: |
cargo install --locked cargo-deny || true
cargo install --locked cargo-outdated || true
cargo install --locked cargo-udeps || true
cargo install --locked cargo-audit || true
cargo install --locked cargo-pants || true
- name: Check
run: |
cargo deny check
cargo outdated --exit-code 1
cargo udeps
rm -rf ~/.cargo/advisory-db
cargo audit
cargo pants
- name: Test
run: cargo test