-
-
Notifications
You must be signed in to change notification settings - Fork 2k
147 lines (133 loc) · 4.67 KB
/
tests.yml
File metadata and controls
147 lines (133 loc) · 4.67 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Check stubs
on:
push:
pull_request:
permissions:
contents: read
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
jobs:
file-consistency:
name: Check file consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install $(grep tomli== requirements-tests-py3.txt)
- run: ./tests/check_consistent.py
pep-604:
name: Check for PEP 604 usage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: ./tests/check_pep_604.py
flake8:
name: Lint with flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install $(grep flake8 requirements-tests-py3.txt)
- run: flake8
black:
name: Check formatting with black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install $(grep black requirements-tests-py3.txt)
- run: black --check --diff stdlib stubs
isort:
name: Check imports with isort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install $(grep isort requirements-tests-py3.txt)
- run: isort --check-only --diff stdlib stubs
pytype:
name: Run pytype against the stubs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: pip install -r requirements-tests-py3.txt
- run: ./tests/pytype_test.py
mypy:
name: Run mypy against the stubs
runs-on: ubuntu-latest
strategy:
matrix:
platform: ["linux", "win32", "darwin"]
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install $(grep tomli== requirements-tests-py3.txt) $(grep mypy== requirements-tests-py3.txt)
- run: ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }}
pyright:
name: Run pyright against the stubs
runs-on: ubuntu-latest
strategy:
matrix:
python-platform: ["Linux", "Windows", "Darwin"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
fail-fast: false
env:
PYRIGHT_VERSION: 1.1.160 # Must match pyright_test.py.
steps:
- uses: actions/checkout@v2
- uses: jakebailey/pyright-action@v1
with:
version: ${{ env.PYRIGHT_VERSION }}
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
no-comments: ${{ matrix.python-version != '3.9' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
project: ./pyrightconfig.stricter.json
- uses: jakebailey/pyright-action@v1
with:
version: ${{ env.PYRIGHT_VERSION }}
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
no-comments: ${{ matrix.python-version != '3.9' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
stubtest-stdlib:
name: Check stdlib with stubtest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
# Python 3.9.7 is required due to changes to ForwardRef.
python-version: ["3.6", "3.7", "3.8", "3.9.7", "3.10.0-rc.2"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
- name: Install dependencies
run: pip install $(grep tomli== requirements-tests-py3.txt) $(grep mypy== requirements-tests-py3.txt)
- name: Run stubtest
run: python tests/stubtest_stdlib.py --ignore-unused-allowlist
stubtest-third-party:
name: Check third party stubs with stubtest
runs-on: ubuntu-latest
strategy:
matrix:
shard-index: [0, 1, 2, 3]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: pip install $(grep tomli== requirements-tests-py3.txt)
- name: Run stubtest
run: python tests/stubtest_third_party.py --num-shards 4 --shard-index ${{ matrix.shard-index }}