9
9
pull_request : {}
10
10
11
11
jobs :
12
- test :
12
+ test-cpython :
13
13
name : test ${{ matrix.python-version }} rust ${{ matrix.rust-toolchain }}
14
14
strategy :
15
15
fail-fast : false
22
22
- ' 3.9'
23
23
- ' 3.10'
24
24
- ' 3.11'
25
- - ' pypy3.7'
26
- - ' pypy3.8'
27
- - ' pypy3.9'
28
25
include :
29
26
- rust-toolchain : stable
30
27
python-version : ' 3.10'
87
84
BENCHMARK_VS_PYDANTIC : 1
88
85
HYPOTHESIS_PROFILE : slow
89
86
90
- # see https://github.com/PyO3/pyo3/discussions/2781
91
- - uses : mxschmitt/action-tmate@v3
92
- if : failure()
93
-
94
87
- run : ls -lha
95
88
- run : coverage xml
96
89
@@ -101,6 +94,64 @@ jobs:
101
94
with :
102
95
env_vars : PYTHON
103
96
97
+ # See https://github.com/PyO3/pyo3/discussions/2781
98
+ # tests intermittently segfault with pypy when using `coverage run ...`, hence separate job
99
+ test-pypy :
100
+ name : test ${{ matrix.python-version }} rust stable
101
+ strategy :
102
+ fail-fast : false
103
+ matrix :
104
+ python-version :
105
+ - ' pypy3.7'
106
+ - ' pypy3.8'
107
+ - ' pypy3.9'
108
+
109
+ runs-on : ubuntu-latest
110
+
111
+ env :
112
+ PYTHON : ${{ matrix.python-version }}
113
+
114
+ steps :
115
+ - uses : actions/checkout@v3
116
+
117
+ - run : rm rust-toolchain
118
+
119
+ - name : install rust stable
120
+ uses : dtolnay/rust-toolchain@stable
121
+
122
+ - name : cache rust
123
+ uses : Swatinem/rust-cache@v2
124
+ with :
125
+ key : pypy-v3
126
+
127
+ - name : set up python
128
+ uses : actions/setup-python@v4
129
+ with :
130
+ python-version : ${{ matrix.python-version }}
131
+
132
+ - id : cache-py
133
+ name : cache python
134
+ uses : actions/cache@v2
135
+ with :
136
+ path : ${{ env.pythonLocation }}
137
+ key : >
138
+ py
139
+ ${{ runner.os }}
140
+ ${{ env.pythonLocation }}
141
+ ${{ hashFiles('tests/requirements.txt') }}
142
+ ${{ hashFiles('pyproject.toml') }}
143
+
144
+ - run : pip install -r tests/requirements.txt
145
+ if : steps.cache-py.outputs.cache-hit != 'true'
146
+
147
+ - run : pip install -e .
148
+ env :
149
+ RUST_BACKTRACE : 1
150
+
151
+ - run : pip freeze
152
+
153
+ - run : pytest
154
+
104
155
lint :
105
156
runs-on : ubuntu-latest
106
157
@@ -220,7 +271,7 @@ jobs:
220
271
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
221
272
check :
222
273
if : always()
223
- needs : [test, lint, bench, build-wasm-emscripten]
274
+ needs : [test-cpython, test-pypy , lint, bench, build-wasm-emscripten]
224
275
runs-on : ubuntu-latest
225
276
steps :
226
277
- name : Decide whether the needed jobs succeeded or failed
0 commit comments