Prep to Open Source #9
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: Pytest | |
on: | |
pull_request: | |
push: | |
branches: [ main ] | |
jobs: | |
pytest: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11", "pypy3.9", "pypy3.10"] | |
exclude: | |
- os: macos-latest | |
python-version: "3.9" | |
- os: windows-latest | |
python-version: "3.9" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install hatch | |
hatch env create dev | |
- name: Test with pytest | |
run: | | |
# Need relative files for the action to report, but it messes up mutmut | |
echo "[run]" >> .coveragerc | |
echo "relative_files = true" >> .coveragerc | |
cat .coveragerc | |
hatch run dev:pytest | |
env: | |
COVERAGE_FILE: ".coverage.${{ matrix.os }}.${{ matrix.python-version }}" | |
- name: Store Pull Request comment to be posted | |
uses: actions/upload-artifact@v4 | |
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | |
with: | |
name: python-coverage-comment-action | |
path: python-coverage-comment-action.txt | |
include-hidden-files: true |