-
Notifications
You must be signed in to change notification settings - Fork 799
157 lines (137 loc) · 4.55 KB
/
main.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
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
148
149
150
151
152
153
154
155
156
157
name: CI
on:
push:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
name: Build and test
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev']
architecture: ['x64', 'x86']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
cache: pip
cache-dependency-path: .github/workflows/main.yml
- name: Setup environment
run: |
python --version
pip --version
pip install --upgrade setuptools wheel
- name: Build and install
run: |
python setup.py --skip-verstamp install --user
- name: Run tests
# Run the tests directly from the source dir so support files (eg, .wav files etc)
# can be found - they aren't installed into the Python tree.
run: python pywin32_testall.py -v -skip-adodbapi
- name: Build wheels
run: |
python setup.py bdist_wheel --skip-build
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: artifacts
path: |
dist/*.whl
dist/*.exe
# We cannot build and test on ARM64, so we cross-compile.
# Later, when available, we can add tests using this wheel on ARM64 VMs
build_arm64:
name: Cross-compile ARM
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12-dev']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
cache: pip
cache-dependency-path: .github/workflows/main.yml
- name: Setup Environment
run: |
python --version
pip --version
pip install --upgrade setuptools wheel
- name: Obtain ARM64 library files
run: |
python .github\workflows\download-arm64-libs.py .\arm64libs
- name: Build wheels
run: python setup.py --skip-verstamp build_ext -L .\arm64libs --plat-name win-arm64 build --plat-name win-arm64 bdist_wheel --plat-name win-arm64
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: artifacts
path: |-
dist/*.whl
# This job can be run locally by running `pre-commit run`
checkers:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# This job only needs to target the oldest supported version (black@stable supports Python >=3.8)
python-version: '3.8'
cache: pip
cache-dependency-path: .github/workflows/main.yml
- run: pip install pycln
- run: pycln . --config=pycln.toml --check
- uses: chartboost/ruff-action@v1
with:
version: '0.3.7'
- uses: psf/black@stable
with:
options: "--fast --check --diff --verbose"
mypy:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
# mypy 1.5 dropped support for Python 3.7
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: .github/workflows/main.yml
- run: pip install types-regex types-setuptools mypy==1.9
- run: mypy . --python-version=${{ matrix.python-version }}
pyright:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: .github/workflows/main.yml
# pyright vendors typeshed, but let's make sure we have the most up to date stubs
- run: pip install types-regex types-setuptools
- uses: jakebailey/pyright-action@v2
with:
python-version: ${{ matrix.python-version }}
annotate: errors