-
Notifications
You must be signed in to change notification settings - Fork 638
197 lines (167 loc) · 5.2 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
name: Test
on:
push:
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
paths-ignore:
- "docs/**"
pull_request:
paths-ignore:
- "docs/**"
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-13
python: 3.11
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: windows-2022
python: "3.7"
arch: x86
- os: windows-2022
python: "3.9"
arch: x64
- os: windows-2022
python: "3.11"
arch: x64
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch || 'x64' }}
# allows us to use '3.12' and get '-dev' while we wait
allow-prereleases: true
- 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"
# preserve pip cache to speed up installation
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ runner.python }}-${{ hashFiles('*requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- 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 -c "import zmq"
- name: run tests
run: |
python -m pytest --maxfail 2 --cov zmq -m "not wheel and not new_console" -v zmq/tests
- 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