-
Notifications
You must be signed in to change notification settings - Fork 4
98 lines (79 loc) · 2.64 KB
/
ci.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
pull_request:
types: [opened, synchronize, reopened]
env:
CARGO_TERM_COLOR: always
NUM_JOBS: 2
RUSTFLAGS: -Dwarnings
jobs:
# Run Format, Lint, and Test in parallel. This way we can get feedback on all topics
# instead of (possibly) failing fast on the first one. It should also be faster.
rustfmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Check linting
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features
test_coverage:
name: Test and coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Setup tarpaulin
uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin
- name: Test
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --release --all-features --engine llvm --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true