Skip to content

some code cleanup (#17) #172

some code cleanup (#17)

some code cleanup (#17) #172

Workflow file for this run

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 }}