From b73a09ac640a5d8882566ca415c355d1571460e9 Mon Sep 17 00:00:00 2001 From: Rui Luo Date: Mon, 30 Mar 2026 16:33:51 +0800 Subject: [PATCH 1/4] coverage: add git safe.directory for linux builds --- .github/workflows/coverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3c0d4fa700..ee5e6d50b2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -67,6 +67,9 @@ jobs: with: fetch-depth: 0 + - name: Mark workspace as safe for git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Install dependencies uses: ./.github/actions/install_unix_deps continue-on-error: false From 326a960b739d62a2a6f9928feeeaac95d8a35bed Mon Sep 17 00:00:00 2001 From: Rui Luo Date: Wed, 1 Apr 2026 10:47:21 +0800 Subject: [PATCH 2/4] coverage: run coverage for linux without root --- .github/workflows/coverage.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ee5e6d50b2..a3141de3f8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -46,7 +46,6 @@ jobs: # Our self-hosted runners require a container # TODO: use a different (nvidia?) container container: - options: -u root --security-opt seccomp=unconfined --shm-size 16g image: ubuntu:22.04 env: NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} @@ -67,9 +66,6 @@ jobs: with: fetch-depth: 0 - - name: Mark workspace as safe for git - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Install dependencies uses: ./.github/actions/install_unix_deps continue-on-error: false From ecf269f7e16e6c5e0330a29088c4032861f0c4b6 Mon Sep 17 00:00:00 2001 From: Rui Luo Date: Tue, 7 Apr 2026 09:06:35 +0800 Subject: [PATCH 3/4] coverage: change github workspace owner for Linux coverage --- .github/workflows/coverage.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1884d79fa9..504a62b431 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -46,6 +46,7 @@ jobs: # Our self-hosted runners require a container # TODO: use a different (nvidia?) container container: + options: -u root --security-opt seccomp=unconfined --shm-size 16g image: ubuntu:22.04 env: NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} @@ -66,6 +67,10 @@ jobs: with: fetch-depth: 0 + - name: Fix workspace ownership + run: | + chown -R $(id -u):$(id -g) "$GITHUB_WORKSPACE" + - name: Install dependencies uses: ./.github/actions/install_unix_deps continue-on-error: false From ed96375114c7bce701a3906877dac5fe2d520340 Mon Sep 17 00:00:00 2001 From: Rui Luo Date: Wed, 8 Apr 2026 16:26:52 +0800 Subject: [PATCH 4/4] coverage: run cuda core tests in coverage using 8M thread --- .github/workflows/coverage.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 504a62b431..f440e5f240 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -380,11 +380,40 @@ jobs: sys.exit(result['code']) PYTEST_EOF - - name: Run cuda.core tests + # Same 8MB stack thread as bindings: Cython linetrace under coverage on Windows + # can need a larger stack than the default thread size. + - name: Run cuda.core tests (with 8MB stack) continue-on-error: true run: | cd "${{ steps.install-root.outputs.INSTALL_ROOT }}" - "$GITHUB_WORKSPACE/.venv/Scripts/pytest" -v --cov=./cuda --cov-append --cov-context=test --cov-config="$GITHUB_WORKSPACE/.coveragerc" "$GITHUB_WORKSPACE/cuda_core/tests" + "$GITHUB_WORKSPACE/.venv/Scripts/python" << PYTEST_EOF + import os + import sys + import threading + import pytest + + os.chdir(r'${{ steps.install-root.outputs.INSTALL_ROOT }}') + threading.stack_size(8 * 1024 * 1024) + result = {'code': 1} + + def _run(): + workspace = os.environ['GITHUB_WORKSPACE'] + result['code'] = pytest.main([ + '-v', + '--cov=./cuda', + '--cov-append', + '--cov-context=test', + f'--cov-config={workspace}/.coveragerc', + f'{workspace}/cuda_core/tests' + ]) + + t = threading.Thread(target=_run) + t.start() + t.join() + + print(f'cuda.core tests exit code: {result["code"]}') + sys.exit(result['code']) + PYTEST_EOF - name: Copy Windows coverage file to workspace run: |