61 lines (53 loc) · 1.96 KB
/
test.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
51
52
53
54
55
56
57
58
59
60
61
name: Test
on:
pull_request:
paths:
- ".github/workflows/test.yml"
- "**.py"
push:
paths:
- ".github/workflows/test.yml"
- "**.py"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
test:
name: ${{ matrix.os }} / ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [Ubuntu, Windows, macOS]
python_version:
["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8", "pypy-3.9"]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
name: Install Python ${{ matrix.python_version }}
with:
python-version: ${{ matrix.python_version }}
# PyPy 3.9 for Windows changed the binary name from pypy3 to pypy3.9
# PyPy 3.7 & 3.8 for Windows still only have pypy3
# https://foss.heptapod.net/pypy/pypy/-/commit/f15239a703325d97ca4fa655d00f3c05f58bd8be adds back pypy3 on 3.9
# pypy3 will be the only 'pypy3'-prefixed common exe name for all platforms once PyPy 7.3.9 is out
# TODO remove this step once pypy3.9 7.3.9 is released
- name: Fix-up PyPy 3.9 executable
run: |
cd $(dirname $(which python))
if [ ! -f pypy3.exe ]; then
ln -s python.exe pypy3.exe
fi
shell: bash
if: ${{ (matrix.os == 'Windows') && (matrix.python_version == 'pypy-3.9') }}
- name: Run nox
run: |
pipx run nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }}
shell: bash
if: ${{ ! startsWith( matrix.python_version, 'pypy' ) }}
# Binary is named 'pypy3', but setup-python specifies it as 'pypy-3.x'.
- name: Run nox for pypy3
run: |
pipx run nox --error-on-missing-interpreters -s tests-pypy3
shell: bash
if: ${{ startsWith( matrix.python_version, 'pypy' ) }}