Skip to content

ci: analyze test coverage #142

ci: analyze test coverage

ci: analyze test coverage #142

Workflow file for this run

name: Pull Request
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
types: [checks_requested]
workflow_dispatch: {}
jobs:
check:
name: Check Python
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Build Hugr validator
uses: PyO3/maturin-action@v1
with:
command: build
sccache: 'true'
working-directory: validator
- name: Install Hugr validator
run: pip install validator/target/wheels/*
- name: Install Guppy
run: pip install -e '.[dev]'
- name: Type check with mypy
run: mypy guppy
- name: Check formatting with black
run: black --check guppy
- name: Run tests
run: pytest
py-coverage:
if: github.event_name != 'merge_group'
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Build Hugr validator
uses: PyO3/maturin-action@v1
with:
command: build
sccache: 'true'
working-directory: validator
- name: Install Hugr validator
run: pip install validator/target/wheels/*
- name: Install Guppy
run: pip install -e '.[dev]'
- name: Run python tests with coverage instrumentation
run: |
pytest --cov=./ --cov-report=xml
- name: Upload python coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: coverage.xml
name: python39
token: ${{ secrets.CODECOV_TOKEN }}