-
Notifications
You must be signed in to change notification settings - Fork 98
66 lines (56 loc) · 1.94 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
62
63
64
65
66
name: coverage
on:
pull_request:
branches:
- master
push:
branches:
- master
env:
CARGO_TERM_COLOR: always
GITHUB_BOT_CONTEXT_STRING: "coveralls coverage reporting job"
jobs:
coverage:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
with:
key: "v2"
- name: Install gnome-keyring and keyutils on Linux
run: |
sudo apt-get update --yes && sudo apt-get install --yes gnome-keyring keyutils
rm -f $HOME/.local/share/keyrings/*
echo -n "test" | gnome-keyring-daemon --unlock
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Build
run: source <(cargo llvm-cov show-env --export-prefix) && cargo build
- name: Test
run: source <(cargo llvm-cov show-env --export-prefix) && cargo test
- name: Generate code coverage
run: source <(cargo llvm-cov show-env --export-prefix) && cargo llvm-cov report --lcov --output-path coverage.lcov --ignore-filename-regex '(bench\/|integration\/|tools\/|tpc\/)'
- name: Upload code to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
finalize_coverage:
runs-on: ubuntu-latest
needs: coverage
if: always()
steps:
- uses: actions/checkout@v4
- name: Everything is fine
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Something went wrong
if: ${{ contains(needs.*.result, 'failure') && github.event_name == 'push' }}
uses: JasonEtco/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_BOT_CONTEXT_STRING: "coveralls coverage reporting job"
with:
filename: .github/BOT_ISSUE_TEMPLATE.md