-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (74 loc) · 2 KB
/
rust-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
name: rust-ci
on:
workflow_dispatch:
push:
branches:
- main
- develop
- "dev/**"
paths:
- "src/**"
- "examples/**"
pull_request:
branches:
- main
- develop
- "dev/**"
paths:
- "src/**"
- "examples/**"
jobs:
code-coverage:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
- name: Clean artefacts
uses: actions-rs/cargo@v1
with:
command: clean
- name: Execute tests
uses: actions-rs/cargo@v1
with:
command: test
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "./target/coverage.prof/cargo-test-%p-%m.profraw"
- name: Install grcov
run: |
rm -rf ./grcov*
wget https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2
tar -xf grcov-x86_64-unknown-linux-gnu.tar.bz2
- name: Collect code coverage
run: |
./grcov ./target/coverage.prof --binary-path \
./target/debug/deps/ -s . \
-t cobertura --ignore-not-existing --ignore '../*' \
--ignore "/*" -o ./coverage.xml
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
clippy-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features