-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (44 loc) · 1.3 KB
/
codecov.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
name: codecov
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
name: Test python API
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install requirements
run: |
pip install pytest pytest-cov && pip install -e .
- name: Run tests and collect coverage
run: |
cd core/
source <(cargo llvm-cov show-env --export-prefix)
export CARGO_TARGET_DIR=$CARGO_LLVM_COV_TARGET_DIR
export CARGO_INCREMENTAL=1
cargo llvm-cov clean --workspace
cargo test
cd ..
pytest --cov=./ --cov-report=xml
cd core/
cargo llvm-cov --no-run --lcov --output-path ../coverage.lcov
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
files: coverage.lcov,coverage.xml
token: ${{ secrets.CODECOV }}