forked from mesonbuild/meson-python
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (71 loc) · 1.84 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: tests
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ${{ matrix.os }}-latest
env:
FORCE_COLOR: true
strategy:
fail-fast: false
matrix:
os:
- ubuntu
- macos
- windows
python:
- 'pypy-3.8'
- 'pypy-3.9'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11-dev'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up target Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Pick environment to run
run: |
import platform
import os
import sys
if platform.python_implementation() == 'PyPy':
base = f'pypy{sys.version_info.major}.{sys.version_info.minor}'
else:
base = f'{sys.version_info.major}.{sys.version_info.minor}'
env = f'BASE={base}\n'
print(f'Picked:\n{env}for {sys.version}')
with open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8') as file:
file.write(env)
shell: python
- name: Set up Python for nox
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install nox
run: |
python -m pip install nox
nox --version
- name: Run tests
run: nox -v -s test-${{ env.BASE }}
- name: Send coverage report
uses: codecov/codecov-action@v1
if: ${{ always() }}
env:
PYTHON: ${{ matrix.python }}
with:
flags: tests
env_vars: PYTHON
name: ${{ matrix.python }}