-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (54 loc) · 1.53 KB
/
coverage.yml
File metadata and controls
63 lines (54 loc) · 1.53 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
60
61
62
63
name: Code Coverage
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
secrets:
codecov_token:
required: true
inputs:
branch:
required: false
type: string
default: "main"
workflow_dispatch:
jobs:
build:
name: Build and Report Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install Python Dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-dev python3-pip python3-venv
- name: Set Up Python Linking
run: |
mkdir -p .cargo
PYTHON_VERSION=$(python3 --version | awk '{print $2}' | cut -d '.' -f 1,2)
PYTHON_LIB_PATH=$(python3-config --prefix)/lib
echo "[build]" >> .cargo/config.toml
echo "rustflags = [\"-L$PYTHON_LIB_PATH\", \"-lpython${PYTHON_VERSION}\"]" >> .cargo/config.toml
shell: bash
- name: Install Tarpaulin
run: cargo install cargo-tarpaulin
- name: Run Tests and Generate Coverage Report
run: cargo tarpaulin --out Lcov --features testing
env:
CARGO_INCREMENTAL: '0'
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./tarpaulin-report.lcov
verbose: true
fail_ci_if_error: true