-
Notifications
You must be signed in to change notification settings - Fork 17
50 lines (46 loc) · 1.42 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Run tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
# Allow triggering manually on other branches.
permissions:
contents: read
pull-requests: read
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [
'3.9', '3.10', '3.11', '3.12', '3.13',
'pypy3.10',
]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'test-requirements.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r test-requirements.txt
- name: Build package
run: |
python -m pip -v install .
- name: Test with pytest
# Enable Python's debug mode to do additional checks, and error if any uncaught warnings are
# produced.
# Disable assertion rewriting on PyPy, it sometimes breaks there.
run: |
python -X dev -Werror -m pytest --assert=${{ contains(matrix.python-version, 'pypy') && 'plain' || 'rewrite' }} tests
# Don't fail for beta versions of Python.
continue-on-error: ${{ contains(matrix.python-version, 'dev') }}