-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (74 loc) · 2.16 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
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
name: Rust
# run on push and pull request to main and release branches
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: "clippy, rustfmt"
- uses: Swatinem/rust-cache@v2
# make sure all code has been formatted with rustfmt and linted with clippy
# - name: rustfmt
# run: cargo fmt -- --check --color always
# run clippy to verify we have no warnings
- run: cargo fetch
- name: cargo clippy
run: cargo clippy -p mqrstt
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: cargo fetch
- name: cargo test build
run: cargo build --tests --release
- name: cargo test
run: cargo test --release
deny-check:
name: cargo-deny
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v2
coverage:
name: Coverage
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-llvm-cov
run: |
curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz \
| tar xzf - -C ~/.cargo/bin
- name: Generate coverage report
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov test -p mqrstt --no-report --all-features
cargo llvm-cov report --lcov > lcov.txt
env:
RUSTFLAGS: --cfg __ui_tests
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov.txt