-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (42 loc) · 1.18 KB
/
code-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
name: Code Coverage
on:
pull_request:
# push:
# branches:
# - main
paths:
- '**/*.rs'
- '!LICENSE'
- '!README.md'
- '!**/*.md'
jobs:
code-coverage:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
rustup default stable
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Install protoc (Protocol Buffers compiler)
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Run code coverage using external script
# Define repo level variable
env:
SKIP_CRATE: ${{ vars.SKIP_CRATE }}
run: |
chmod u+x scripts/run_coverage.sh
./scripts/run_coverage.sh
- name: Upload coverage results
if: always()
uses: actions/upload-artifact@v3
with:
name: coverage-lcov
path: "**/coverage/lcov.info"