This repository has been archived by the owner on Oct 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 1.68 KB
/
test.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
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
steps:
- uses: actions/checkout@v3
- name: Setup tooling
run: |
rustup update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
rustup component add clippy
rustup component add rustfmt
rustup component add llvm-tools-preview
- name: Toolchain info
run: |
cargo --version --verbose
rustc --version
cargo clippy --version
- name: Using cache
uses: Swatinem/[email protected]
with:
cache-all-crates: "true"
cache-on-failure: "true"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Check package
run: cargo check
- name: Check formatting
run: cargo fmt -- --check
- name: Lint
run: cargo clippy -- -D warnings -A dead_code
- name: Test
env:
TEST_ONLY: cargo test
TEST_COVERAGE: |
cargo llvm-cov test \
--all-features \
--workspace \
--codecov \
--output-path codecov.json \
--ignore-filename-regex '_tests\.rs'
run: ${{ matrix.toolchain == 'stable' && env.TEST_COVERAGE || env.TEST_ONLY }}
- name: Upload coverage to Codecov
if: matrix.toolchain == 'stable'
uses: codecov/[email protected]
with:
files: codecov.json