forked from dlunch/RustJava
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.71 KB
/
Copy pathcoverage.yml
File metadata and controls
46 lines (40 loc) · 1.71 KB
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
name: coverage
on: [push]
jobs:
test:
name: coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Cache cargo
uses: actions/cache@v6
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo
- name: Cache cargo build
uses: actions/cache@v6
with:
path: target
key: ${{ runner.os }}-stable-coverage-build-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-stable-coverage-build-target-
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v7
with:
files: lcov.info
# This fork has no CODECOV_TOKEN (secrets are not inherited from the
# upstream repo), so every upload is rejected with "Token required -
# not valid tokenless upload". Failing CI on that made `coverage` red
# on all 24 runs since the workflow started reporting, which buries
# real regressions instead of surfacing them. Upload errors are now
# non-fatal; the error text is still printed in this step's log.
# The coverage run itself is the separate "Generate code coverage"
# step above, which still fails the job if the build or tests break.
# Set CODECOV_TOKEN on this fork to make uploads work again.
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}