Skip to content

CI make coverage account for full test matrix #330

CI make coverage account for full test matrix

CI make coverage account for full test matrix #330

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
run-test-suite:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9']
env:
# https://github.com/microsoft/azure-pipelines-tasks/issues/16426
# https://github.com/orgs/community/discussions/26434
MPLBACKEND: Agg
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Ensure latest pip
run: python -m pip install --upgrade pip
- name: Install hatch
run: |
pip install hatch
- if: matrix.python-version == '3.9' && runner.os == 'Linux'
name: Lint
run: hatch run lint:all
- if: matrix.python-version == '3.9' && runner.os == 'Linux'
name: Build docs
run: hatch run docs:build
- name: Run tests with coverage report
# run: hatch run cov --cov-report=xml
# Run coverage with hatch test matrix and cov-append.
run: |
hatch run cov-erase
hatch run test:cov --cov-report=xml
- if: matrix.python-version == '3.9' && runner.os == 'Linux'
name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- if: matrix.python-version == '3.9' && runner.os == 'Linux'
name: Run test matrix
run: |
hatch -e test run versions
hatch -e test run pytest