This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (49 loc) · 1.55 KB
/
tests.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
name: tests
on:
push:
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
workflow_dispatch:
branches: ["*"]
jobs:
unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
with:
profile: minimal
toolchain: stable
components: llvm-tools-preview
override: true
- name: Install cargo-llvm-cov
run: |
if type cargo-llvm-cov >/dev/null 2>&1; then echo "cargo-llvm-cov is already installed"; else cargo install cargo-llvm-cov ; fi
- name: Installing needed dependencies
run: sudo apt-get install -y protobuf-compiler
- name: Run cargo-llvm-cov
run: |
cargo llvm-cov --all-features --lib --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}