-
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.36 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
name: Test coverage
on:
push:
branches: [main]
pull_request:
branches:
- main
# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
coverage:
name: Collect test coverage
runs-on: ubuntu-latest
env:
# The `coverage_nightly` cfg value is not recognized, so we need to allow unknown
# cfg values in order to have the build succeed.
RUSTFLAGS: -D warnings -A unexpected_cfgs
CARGO_TERM_COLOR: always
steps:
- uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- name: Install zsh
run: sudo apt install -y zsh
- uses: taiki-e/install-action@just
- uses: taiki-e/install-action@nextest
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage data
# Generate coverage report using nextest.
run: |
just coverage-tests
cargo llvm-cov report --doctests --lcov --output-path lcov.info
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info