| 1 |
name: test |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- master |
| 10 |
|
| 11 |
concurrency: |
| 12 |
group: test-${{ github.head_ref }} |
| 13 |
cancel-in-progress: true |
| 14 |
|
| 15 |
env: |
| 16 |
PYTHONUNBUFFERED: "1" |
| 17 |
FORCE_COLOR: "1" |
| 18 |
|
| 19 |
jobs: |
| 20 |
run: |
| 21 |
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} |
| 22 |
runs-on: ${{ matrix.os }} |
| 23 |
strategy: |
| 24 |
fail-fast: false |
| 25 |
matrix: |
| 26 |
os: [ubuntu-latest, windows-latest, macos-latest] |
| 27 |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] |
| 28 |
|
| 29 |
steps: |
| 30 |
- uses: actions/checkout@v3 |
| 31 |
|
| 32 |
- name: Set up Python ${{ matrix.python-version }} |
| 33 |
uses: actions/setup-python@v4 |
| 34 |
with: |
| 35 |
python-version: ${{ matrix.python-version }} |
| 36 |
|
| 37 |
- name: Install Hatch |
| 38 |
run: pip install --upgrade hatch |
| 39 |
|
| 40 |
- if: matrix.python-version == '3.9' && runner.os == 'Linux' |
| 41 |
name: Lint |
| 42 |
run: hatch run lint:all |
| 43 |
|
| 44 |
- name: Run tests |
| 45 |
run: hatch run cov |