@@ -2,6 +2,9 @@ name: "Testing package"
22
33on :
44 pull_request :
5+ push :
6+ branches :
7+ - master
58
69jobs :
710 py-lint :
@@ -83,29 +86,39 @@ jobs:
8386 - uses : actions-rs/toolchain@v1
8487 with :
8588 toolchain : stable
86- components : clippy
89+ components : llvm-tools-preview
8790 override : true
8891 - uses : actions/setup-python@v6
8992 with :
9093 python-version : 3.x
9194 - name : Install uv
9295 uses : astral-sh/setup-uv@v7
96+ - name : Install llvm-cov
97+ uses : taiki-e/install-action@v2
98+ with :
99+ tool : cargo-llvm-cov
93100 - id : prepare-container
94101 name : Prepare docker container
95102 run : docker compose up -d --wait
96103 - id : setup-venv
97104 name : Setup virtualenv
98- run : python -m venv .venv
99- - name : Build lib
100- uses : PyO3/maturin-action@v1
101- with :
102- command : dev --uv
103- sccache : true
105+ run : uv venv
104106 - name : Run pytest
105107 run : |
106108 set -e
107- source .venv/bin/activate
108- pytest -vv -n auto python/tests
109+ source <(cargo llvm-cov show-env --sh)
110+ export CARGO_TARGET_DIR="$CARGO_LLVM_COV_TARGET_DIR"
111+ export CARGO_INCREMENTAL="1"
112+ cargo llvm-cov clean --workspace
113+ uv run -- maturin dev --uv
114+ uv run -- pytest -vv python/tests --cov natsrpy --cov-report xml
115+ cargo llvm-cov report --lcov --output-path coverage.lcov
116+ - uses : codecov/codecov-action@v5
117+ with :
118+ fail_ci_if_error : false
119+ token : ${{ secrets.CODECOV_TOKEN }}
120+ files : coverage.lcov,coverage.xml
121+ verbose : true
109122 - name : Teardown docker
110123 if : always()
111124 run : docker compose down
0 commit comments