Skip to content

Add testing job to CI on push to main and PR #13

Add testing job to CI on push to main and PR

Add testing job to CI on push to main and PR #13

Workflow file for this run

on:
push:
branches:
- main
pull_request:
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: "3.11"
- name: Install Rust Toolchain
run: rustup toolchain install stable --profile minimal --no-self-update
- name: Install requirements
run: |
python -m venv venv
. venv/bin/activate
pip install maturin
pip install -r tests/requirements.txt
maturin develop
- name: Install codecov cli
run: |
pip install --no-cache-dir git+https://github.com/codecov/codecov-cli.git@joseph/test-results-staging
- name: Run tests
run: |
. venv/bin/activate
python -m pytest --cov-report=xml:coverage.xml --cov=. --junitxml=unit.junit.xml
- name: Upload results to codecov
if: success() || failure()
run: |
codecovcli -u ${{ secrets.CODECOV_STAGING_API_URL }} create-commit -t ${{ secrets.CODECOV_ORG_TOKEN_STAGING }}
codecovcli -u ${{ secrets.CODECOV_STAGING_API_URL }} create-report -t ${{ secrets.CODECOV_ORG_TOKEN_STAGING }}
codecovcli -u ${{ secrets.CODECOV_STAGING_API_URL }} --verbose do-upload -t ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} --report-type test_results --flag unit --file unit.junit.xml --disable-search --plugin None
codecovcli -u ${{ secrets.CODECOV_STAGING_API_URL }} --verbose do-upload -t ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} --file coverage.xml