-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.71 KB
/
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
name: ci
on:
push:
branches: [ main ]
paths-ignore: [ '**.md' ]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build files cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-v1-${{ hashFiles('**/Cargo.lock') }}
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: llvm-tools-preview
- name: Run tests with coverage
uses: actions-rs/cargo@v1
with:
command: test
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -C instrument-coverage
LLVM_PROFILE_FILE: coverage-%p-%m.profraw
- name: Install coverage tool
uses: actions-rs/cargo@v1
with:
command: install
args: grcov --version 0.8.11
- name: Collect coverage statistics
run: grcov . --source-dir . --binary-path ./target/debug/ --llvm --branch --output-type html --output-path ./coverage
id: grcov
- name: Publish coverage statistics
if: steps.grcov.conclusion == 'success'
uses: cpina/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.GH_ACCESS_TOKEN }}
with:
source-directory: 'coverage'
destination-github-username: 'feroldi'
destination-repository-name: 'atlas-coverage'
target-branch: master