-
-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (66 loc) · 1.9 KB
/
coverage.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
name: Coverage
on:
workflow_dispatch:
push:
branches: [main, release-*]
pull_request:
branches: [main, release-*]
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
runs-on: ubuntu-latest
env:
DISPLAY: ':99'
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxtst-dev libevdev-dev libxdo-dev
version: 1.0
- name: Setup headless environment
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- name: Dependencies
run: |
sudo apt-get install libxtst-dev libevdev-dev libxdo-dev --assume-yes
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
# To only cache runs from `master`
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: rustup component add llvm-tools-preview
- name: Install grcov
uses: actions-rs/[email protected]
with:
crate: grcov
version: latest
use-tool-cache: true
- name: build
env:
RUSTFLAGS: -Cinstrument-coverage
run: cargo build --workspace --verbose
- name: test
env:
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: name-%p-%m.profraw
run: cargo test --workspace --verbose
- name: Run grcov
run: |
mkdir coverage
grcov . \
--binary-path ./target/debug/ \
-s . \
-t lcov \
--branch \
--ignore-not-existing \
--ignore "/*" \
--ignore "service/src/{main}.rs" \
--excl-line "#\\[derive\\(" \
-o ./coverage/lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}