-
Notifications
You must be signed in to change notification settings - Fork 24
90 lines (74 loc) · 2.17 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: ☂ Code Coverage
on:
push:
branches: [main]
pull_request:
branches: ["*"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
rust: ${{ steps.filter.outputs.rust }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rust:
- '**/Cargo.*'
- '**/src/**'
- '**/tests/**'
- '**/config/**'
- '**/build.rs'
- '**/migrations/**'
- '**/fixtures/**'
coverage:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Setup IPFS
uses: ibnesayeed/setup-ipfs@master
with:
run_daemon: false
- name: Checkout Repository
uses: actions/checkout@v4
- name: Use mold-linker
uses: rui314/setup-mold@v1
- name: Install Rust Toolchain
id: toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Override rust-toolchain.toml
run: rustup override set ${{steps.toolchain.outputs.name}}
- name: Cache Project
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
save-if: ${{ github.event_name == 'push' }}
- name: Sccache
uses: mozilla-actions/[email protected]
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Generate code coverage (nextest)
run: cargo llvm-cov nextest --all-features --workspace --profile=ci --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
files: lcov.info