MNT hatchling >= 1.26.3 #443
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.11'] # hatch env defines its own matrix with python versions | |
env: | |
# https://github.com/microsoft/azure-pipelines-tasks/issues/16426 | |
# https://github.com/orgs/community/discussions/26434 | |
MPLBACKEND: Agg | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
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.11' && runner.os == 'Linux' | |
name: Formatter & Linter | |
run: hatch run format:check | |
- if: matrix.python-version == '3.11' && runner.os == 'Linux' | |
name: Build docs | |
run: hatch run docs:build | |
- name: Run test matrix | |
run: | | |
hatch -e test run versions | |
hatch -e test run pytest | |
- if: matrix.python-version == '3.11' && runner.os == 'Linux' | |
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.11' && runner.os == 'Linux' | |
name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |