GitHub workflows: Run tests before publishing to PyPI #9
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 | |
- dev | |
workflow_call: | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
# Python 3.6 is unavailable on ubuntu-22.04, ignore it for now | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: python3 -m pip install --upgrade build hatch pytest | |
- name: Run tests | |
run: hatch run test:pytest |