forked from zeromq/pyzmq
-
Notifications
You must be signed in to change notification settings - Fork 1
235 lines (193 loc) · 6.24 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Test
on:
push:
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
paths-ignore:
- "docs/**"
- "tools/**"
- ".circleci/**"
- ".github/workflows/*"
- "!.github/workflows/test.yml"
pull_request:
paths-ignore:
- "docs/**"
- "tools/**"
- ".circleci/**"
- ".github/workflows/*"
- "!.github/workflows/test.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
# only affects Windows, but easiest to set here for now
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 20
continue-on-error: ${{ matrix.zmq == 'head' }}
env:
MACOSX_DEPLOYMENT_TARGET: "11.7"
strategy:
fail-fast: true
matrix:
include:
- os: macos-13
python: "3.7"
- os: macos-14
python: "3.12"
zmq: bundled
- os: macos-14
python: "3.13"
zmq: bundled
- os: macos-13
python: pypy-3.9
zmq: bundled
- os: ubuntu-20.04
python: "3.7"
zmq: bundled
tornado: none
- os: ubuntu-22.04
python: pypy-3.9
zmq: bundled
- os: ubuntu-22.04
python: pypy-3.7
- os: ubuntu-22.04
python: "3.9"
tornado: head
- os: ubuntu-22.04
python: "3.10"
- os: ubuntu-22.04
python: "3.11"
- os: ubuntu-22.04
python: "3.8"
zmq: head
- os: ubuntu-22.04
python: "3.12"
- os: ubuntu-22.04
python: "3.13"
- os: ubuntu-22.04
python: "3.13"
free_threading: free_threading
- os: windows-2022
python: "3.7"
arch: x86
- os: windows-2022
python: "3.9"
arch: x64
- os: windows-2022
python: "3.13"
arch: x64
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
if: ${{ !matrix.free_threading }}
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch || 'x64' }}
# allows us to use '3.12' and get '-dev' while we wait
allow-prereleases: true
cache: pip
- name: setup python (free threading)
if: ${{ matrix.free_threading }}
uses: mamba-org/setup-micromamba@v1
with:
environment-name: nogil
condarc: |
channels:
- ad-testing/label/py313_nogil
- defaults
create-args: >-
python=${{ matrix.python-version }}
pip
- name: activate python (free threading)
if: ${{ matrix.free_threading }}
# light activate, just add env to path
# run this in micromamba-shell
# so we don't have to for the rest
run: |
echo $PATH
echo "PATH=$PATH" >> "$GITHUB_ENV"
echo "PYTHON_GIL=0" >> "$GITHUB_ENV"
# need prerelease Cython until 3.1 is out
echo "PIP_PRE=1" >> "$GITHUB_ENV"
echo "PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" >> "$GITHUB_ENV"
shell: micromamba-shell {0}
- name: setup coverage
if: startsWith(matrix.python, 'pypy') || startsWith(matrix.python, '3.12')
run: |
grep -v plugins .coveragerc > .coveragerc-save
mv .coveragerc-save .coveragerc
# - name: enable Cython coverage
# if: "! (startsWith(matrix.python, 'pypy') || startsWith(matrix.python, '3.12'))"
# run: |
# echo "PYZMQ_CYTHON_COVERAGE=1" >> "$GITHUB_ENV"
- name: install dependencies
run: |
pip install --upgrade pip wheel
pip install -r test-requirements.txt
- name: remove tornado
if: matrix.tornado == 'none'
run: |
pip uninstall -y tornado
- name: install tornado-head
if: matrix.tornado == 'head'
run: |
pip install https://github.com/tornadoweb/tornado/archive/HEAD.zip
- name: install pinned tornado
if: matrix.tornado && matrix.tornado != 'none' && matrix.tornado != 'head'
run: |
pip install tornado=="${{ matrix.tornado }}"
- name: show environment
run: |
pip freeze
- name: install mac dependencies
if: startsWith(matrix.os, 'mac') && matrix.zmq != 'bundled'
run: |
brew install libsodium zeromq
- name: install linux dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y remove libzmq5 || true # workaround https://github.com/actions/virtual-environments/issues/3317
sudo apt-get -y install libzmq3-dev libsodium-dev
- name: set $ZMQ_PREFIX
if: matrix.zmq
run: |
echo "ZMQ_PREFIX=${{ matrix.zmq }}" >> "$GITHUB_ENV"
- name: install libzmq-dev
if: matrix.zmq == 'head'
run: |
wget https://github.com/zeromq/libzmq/archive/HEAD.zip -O libzmq.zip
unzip libzmq.zip
pushd libzmq-*
./autogen.sh
./configure --enable-drafts
make -j4
sudo make install
sudo ldconfig
popd
echo "ZMQ_PREFIX=/usr/local" >> "$GITHUB_ENV"
echo ZMQ_DRAFT_API=1 >> "$GITHUB_ENV"
- name: build pyzmq
run: |
pip install -v -e .
- name: import zmq
run: |
python -I -c "import zmq"
- name: run tests
run: |
pytest --maxfail 2 --cov zmq -m "not wheel and not new_console" -v
- name: upload coverage
run: codecov
# FIXME: what's the right incantation to call this?
# the same line from appveyor doesn't work here
# - name: run extra windows tests
# if: startsWith(matrix.os, 'win')
# run: |
# cmd /c start /wait test pytest -vsx -m new_console --pyargs zmq.tests --junit-xml=./results.xml
# python tools/check_junit_result.py ./results.xml