forked from zeitgeistpm/zeitgeist
-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (52 loc) · 1.84 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
name: Coverage
on:
pull_request:
types: [ labeled ]
push:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: Coverage
if: |
github.event_name == 'pull_request' &&
(contains(github.event.pull_request.labels.*.name, 's:review-needed') ||
contains(github.event.pull_request.labels.*.name, 's:accepted')) ||
github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install rust toolchain
run: rustup show
- uses: actions-rs/[email protected]
with:
crate: grcov
use-tool-cache: true
# No disk space: https://github.com/zeitgeistpm/zeitgeist/actions/runs/5085081984/jobs/9144298675?pr=1006
# Workaround: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Free up disk space on GitHub hosted runners
run: |
# Ensure context is GitHub hosted runner
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
if [[ "${{ runner.name }}" == "GitHub Actions"* ]]; then
echo "Freeing up space in GitHub hosted runner"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
fi
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Generate coverage report
run: ./scripts/tests/coverage.sh
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ runner.temp }}/zeitgeist-test-coverage.lcov
fail_ci_if_error: true
flags: tests
verbose: true
name: unit-tests