Repository navigation
59 lines (52 loc) · 1.86 KB
/
Copy pathcoverage.yml
File metadata and controls
59 lines (52 loc) · 1.86 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
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Coverage
on:
push:
tags: ["v*"]
branches: ["master"]
pull_request:
branches: ["master"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
compile:
name: Coverage
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Coverage is only collected on Ubuntu for pull requests; the full
# macOS/Windows set runs on pushes to master and on release tags.
os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["macos-latest", "windows-latest", "ubuntu-latest"]') }}
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: coverage-${{ hashFiles('**/Cargo.toml') }}-${{ matrix.os }}
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Cargo test and coverage
uses: clechasseur/rs-cargo@v4
with:
tool: cross
command: "llvm-cov"
args: --workspace --exclude clash-ffi -F "plus" --codecov --output-path codecov.json
env:
CROSS_CONTAINER_OPTS: "--network host"
CLASH_DOCKER_TEST: ${{ startsWith(matrix.os, 'ubuntu') && 'true' || 'false' }}
TS_AUTH_KEY: ${{ secrets.TS_AUTH_KEY }}
RUST_LOG: ts_control=debug,ts_runtime=debug,tailscale=debug
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true