forked from farm-fe/farm
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.56 KB
/
coverage.yaml
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
name: Code Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 10240
temp-reserve-mb: 4096
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
- uses: actions/checkout@v3
- name: Install Rust
uses: oxidecomputer/actions-rs_toolchain@oxide/master
- name: Cache rust artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: cargo-test-code-coverage-grcov
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install -g pnpm && pnpm i --frozen-lockfile
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: rustup component add llvm-tools-preview
- run: cargo install grcov
- run: CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test --tests
- run: grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/tests.lcov
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: target/tests.lcov