Skip to content

update Workflow Actions, badge URLs, and codecov token #12

update Workflow Actions, badge URLs, and codecov token

update Workflow Actions, badge URLs, and codecov token #12

Workflow file for this run

name: CI
on:
push:
pull_request:
jobs:
coverage:
name: Coverage for ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu"]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Rust setup
run: rustup toolchain install stable --profile minimal
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
with:
key: coverage-cargo-${{ matrix.os }}
continue-on-error: true
- name: Setup virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run coverage
run: |
source venv/bin/activate
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
maturin develop
pytest tests --cov=foobar --cov-report lcov:python-coverage.lcov
cargo llvm-cov report --lcov --output-path rust-coverage.lcov
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
files: python-coverage.lcov,rust-coverage.lcov
name: ${{ matrix.os }}
token: ${{ secrets.CODECOV_TOKEN }}