Skip to content

Commit 7f01bff

Browse files
authored
disable coverage on CI with PyPy (#344)
* disable coverage on CI with PyPy * move pypy to separate job * fix typo
1 parent bb28794 commit 7f01bff

File tree

1 file changed

+60
-9
lines changed

1 file changed

+60
-9
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
pull_request: {}
1010

1111
jobs:
12-
test:
12+
test-cpython:
1313
name: test ${{ matrix.python-version }} rust ${{ matrix.rust-toolchain }}
1414
strategy:
1515
fail-fast: false
@@ -22,9 +22,6 @@ jobs:
2222
- '3.9'
2323
- '3.10'
2424
- '3.11'
25-
- 'pypy3.7'
26-
- 'pypy3.8'
27-
- 'pypy3.9'
2825
include:
2926
- rust-toolchain: stable
3027
python-version: '3.10'
@@ -87,10 +84,6 @@ jobs:
8784
BENCHMARK_VS_PYDANTIC: 1
8885
HYPOTHESIS_PROFILE: slow
8986

90-
# see https://github.com/PyO3/pyo3/discussions/2781
91-
- uses: mxschmitt/action-tmate@v3
92-
if: failure()
93-
9487
- run: ls -lha
9588
- run: coverage xml
9689

@@ -101,6 +94,64 @@ jobs:
10194
with:
10295
env_vars: PYTHON
10396

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+
104155
lint:
105156
runs-on: ubuntu-latest
106157

@@ -220,7 +271,7 @@ jobs:
220271
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
221272
check:
222273
if: always()
223-
needs: [test, lint, bench, build-wasm-emscripten]
274+
needs: [test-cpython, test-pypy, lint, bench, build-wasm-emscripten]
224275
runs-on: ubuntu-latest
225276
steps:
226277
- name: Decide whether the needed jobs succeeded or failed

0 commit comments

Comments
 (0)