|
68 | 68 | with: |
69 | 69 | fetch-depth: 0 |
70 | 70 |
|
| 71 | + - name: Fix workspace ownership |
| 72 | + run: | |
| 73 | + chown -R $(id -u):$(id -g) "$GITHUB_WORKSPACE" |
| 74 | +
|
71 | 75 | - name: Install dependencies |
72 | 76 | uses: ./.github/actions/install_unix_deps |
73 | 77 | continue-on-error: false |
@@ -342,46 +346,25 @@ jobs: |
342 | 346 | cd "${{ steps.install-root.outputs.INSTALL_ROOT }}" |
343 | 347 | "$GITHUB_WORKSPACE/.venv/Scripts/pytest" -v --cov=./cuda --cov-append --cov-context=test --cov-config="$GITHUB_WORKSPACE/.coveragerc" "$GITHUB_WORKSPACE/cuda_pathfinder/tests" |
344 | 348 |
|
| 349 | + # Cython linetrace under coverage on Windows needs more stack than the |
| 350 | + # default 1 MB thread size. The helper runs pytest on an 8 MB thread. |
345 | 351 | - name: Run cuda.bindings tests (with 8MB stack) |
346 | 352 | continue-on-error: true |
347 | 353 | run: | |
348 | | - cd "${{ steps.install-root.outputs.INSTALL_ROOT }}" |
349 | | - # Run pytest in 8MB stack thread (Cython linetrace requirement) |
350 | | - "$GITHUB_WORKSPACE/.venv/Scripts/python" << PYTEST_EOF |
351 | | - import os |
352 | | - import sys |
353 | | - import threading |
354 | | - import pytest |
355 | | -
|
356 | | - os.chdir(r'${{ steps.install-root.outputs.INSTALL_ROOT }}') |
357 | | - threading.stack_size(8 * 1024 * 1024) |
358 | | - result = {'code': 1} |
359 | | -
|
360 | | - def _run(): |
361 | | - workspace = os.environ['GITHUB_WORKSPACE'] |
362 | | - result['code'] = pytest.main([ |
363 | | - '-v', |
364 | | - '--cov=./cuda', |
365 | | - '--cov-append', |
366 | | - '--cov-context=test', |
367 | | - f'--cov-config={workspace}/.coveragerc', |
368 | | - f'{workspace}/cuda_bindings/tests' |
369 | | - ]) |
370 | | -
|
371 | | - t = threading.Thread(target=_run) |
372 | | - t.start() |
373 | | - t.join() |
374 | | -
|
375 | | - print(f'Bindings tests exit code: {result["code"]}') |
376 | | - # Exit with actual code (continue-on-error handles it) |
377 | | - sys.exit(result['code']) |
378 | | - PYTEST_EOF |
| 354 | + "$GITHUB_WORKSPACE/.venv/Scripts/python" "$GITHUB_WORKSPACE/ci/tools/run_pytest_with_stack.py" \ |
| 355 | + --cwd "${{ steps.install-root.outputs.INSTALL_ROOT }}" \ |
| 356 | + -v --cov=./cuda --cov-append --cov-context=test \ |
| 357 | + --cov-config="$GITHUB_WORKSPACE/.coveragerc" \ |
| 358 | + "$GITHUB_WORKSPACE/cuda_bindings/tests" |
379 | 359 |
|
380 | | - - name: Run cuda.core tests |
| 360 | + - name: Run cuda.core tests (with 8MB stack) |
381 | 361 | continue-on-error: true |
382 | 362 | run: | |
383 | | - cd "${{ steps.install-root.outputs.INSTALL_ROOT }}" |
384 | | - "$GITHUB_WORKSPACE/.venv/Scripts/pytest" -v --cov=./cuda --cov-append --cov-context=test --cov-config="$GITHUB_WORKSPACE/.coveragerc" "$GITHUB_WORKSPACE/cuda_core/tests" |
| 363 | + "$GITHUB_WORKSPACE/.venv/Scripts/python" "$GITHUB_WORKSPACE/ci/tools/run_pytest_with_stack.py" \ |
| 364 | + --cwd "${{ steps.install-root.outputs.INSTALL_ROOT }}" \ |
| 365 | + -v --cov=./cuda --cov-append --cov-context=test \ |
| 366 | + --cov-config="$GITHUB_WORKSPACE/.coveragerc" \ |
| 367 | + "$GITHUB_WORKSPACE/cuda_core/tests" |
385 | 368 |
|
386 | 369 | - name: Copy Windows coverage file to workspace |
387 | 370 | run: | |
|
0 commit comments