Skip to content

Commit 9165ceb

Browse files
committed
Merge Valgrind and other deadsnakes builds
1 parent 3c6efb6 commit 9165ceb

File tree

1 file changed

+25
-52
lines changed

1 file changed

+25
-52
lines changed

.github/workflows/ci.yml

+25-52
Original file line numberDiff line numberDiff line change
@@ -164,31 +164,43 @@ jobs:
164164
- name: Setuptools helpers test
165165
run: pytest tests/extra_setuptools
166166

167-
valgrind:
167+
168+
deadsnakes:
169+
strategy:
170+
fail-fast: false
171+
matrix:
172+
python:
173+
- version: 3.9
174+
debug: true
175+
valgrind: true
176+
- version: 3.10-dev
177+
debug: false
178+
179+
name: "🐍 ${{ matrix.python.version }}${{ matrix.python.debug && ' (debug)' || '' }}${{ matrix.valgrind && ' • Valgrind' || '' }} • deadsnakes • x64"
168180
runs-on: ubuntu-latest
169-
name: "🐍 3.9 (debug) • Valgrind"
170181

171182
steps:
172183
- uses: actions/checkout@v2
173184

174-
- name: Install debug Python
185+
- name: Setup Python ${{ matrix.python.version }} (deadsnakes)
175186
uses: deadsnakes/action@v2.1.1
176187
with:
177-
python-version: 3.9
178-
debug: true
188+
python-version: ${{ matrix.python.version }}
189+
debug: ${{ matrix.python.debug }}
179190

180191
- name: Update CMake
181192
uses: jwlawson/actions-setup-cmake@v1.6
182193

183194
- name: Valgrind cache
195+
if: matrix.valgrind
184196
uses: actions/cache@v2
185197
id: cache-valgrind
186198
with:
187199
path: valgrind
188200
key: 3.16.1 # Valgrind version
189201

190202
- name: Compile Valgrind
191-
if: steps.cache-valgrind.outputs.cache-hit != 'true'
203+
if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true'
192204
run: |
193205
VALGRIND_VERSION=3.16.1
194206
curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj
@@ -198,13 +210,12 @@ jobs:
198210
make -j 2 > /dev/null
199211
200212
- name: Install Valgrind
213+
if: matrix.valgrind
201214
working-directory: valgrind
202-
run: sudo make install
203-
204-
- name: Install requirement for Valgrind
205215
run: |
216+
sudo make install
206217
sudo apt-get update
207-
sudo apt-get install libc6-dbg
218+
sudo apt-get install libc6-dbg # Needed by Valgrind
208219
209220
- name: Prepare env
210221
run: python -m pip install -r tests/requirements.txt --prefer-binary
@@ -224,51 +235,13 @@ jobs:
224235
- name: Python tests
225236
run: cmake --build build --target pytest
226237

227-
- name: Run Valgrind on Python tests
228-
run: cmake --build build --target memcheck
229-
230-
deadsnakes:
231-
strategy:
232-
fail-fast: false
233-
matrix:
234-
python:
235-
- version: 3.9
236-
debug: true
237-
- version: 3.10-dev
238-
debug: false
239-
240-
name: "🐍 ${{ matrix.python.version }}${{ matrix.python.debug && ' (debug)' || '' }} • deadsnakes • x64"
241-
runs-on: ubuntu-latest
242-
243-
steps:
244-
- uses: actions/checkout@v2
245-
246-
- name: Setup Python ${{ matrix.python.version }} (deadsnakes)
247-
uses: deadsnakes/action@v2.1.1
248-
with:
249-
python-version: ${{ matrix.python.version }}
250-
debug: ${{ matrix.python.debug }}
251-
252-
- name: Prepare env
253-
run: python -m pip install -r tests/requirements.txt --prefer-binary
254-
255-
- name: Configure
256-
run: >
257-
cmake -S . -B build
258-
-DPYBIND11_WERROR=ON
259-
-DDOWNLOAD_CATCH=ON
260-
-DDOWNLOAD_EIGEN=ON
261-
-DCMAKE_CXX_STANDARD=17
262-
263-
- name: Build
264-
run: cmake --build build -j 2
265-
266-
- name: Python tests
267-
run: cmake --build build --target pytest
268-
269238
- name: C++ tests
270239
run: cmake --build build --target cpptest
271240

241+
- name: Run Valgrind on Python tests
242+
if: matrix.valgrind
243+
run: cmake --build build --target memcheck
244+
272245

273246
# Testing on clang using the excellent silkeh clang docker images
274247
clang:

0 commit comments

Comments
 (0)