Skip to content

Run docs deploy without project sync #2409

Run docs deploy without project sync

Run docs deploy without project sync #2409

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: false
workflow_dispatch:
push:
tags:
- v*
branches:
- main
- release-*
schedule: # Schedule workflow only runs on the default branch
- cron: "45 9 * * *"
env:
PYTHONFAULTHANDLER: "1" # Dump tracebacks on fatal signals (SIGSEGV, SIGABRT, etc.)
jobs:
build-warp:
if: github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
platform: windows
cuda-version: "12.9.1"
artifact-name: build-artifact-windows-cuda12
cuda-sub-packages: '["cudart", "nvcc", "nvrtc_dev", "nvjitlink"]'
cuda-non-cuda-packages: ''
- os: windows-2025
platform: windows
cuda-version: "13.0.2"
artifact-name: build-artifact-windows-cuda13
cuda-sub-packages: '["cudart", "crt", "nvcc", "nvrtc_dev", "nvjitlink", "nvvm", "nvptxcompiler"]'
cuda-non-cuda-packages: ''
- os: ubuntu-24.04
platform: ubuntu-x86_64
cuda-version: "12.9.1"
artifact-name: build-artifact-ubuntu-x86_64-cuda12
cuda-sub-packages: '["cudart-dev", "nvcc", "nvrtc-dev"]'
cuda-non-cuda-packages: '["libnvjitlink-dev"]'
- os: ubuntu-24.04
platform: ubuntu-x86_64
cuda-version: "13.0.2"
artifact-name: build-artifact-ubuntu-x86_64-cuda13
cuda-sub-packages: '["cudart-dev", "nvcc", "nvrtc-dev"]'
cuda-non-cuda-packages: '["libnvjitlink-dev"]'
- os: ubuntu-24.04-arm
platform: ubuntu-aarch64
cuda-version: "12.9.1"
artifact-name: build-artifact-ubuntu-aarch64-cuda12
cuda-sub-packages: '["cudart-dev", "nvcc", "nvrtc-dev"]'
cuda-non-cuda-packages: '["libnvjitlink-dev"]'
- os: ubuntu-24.04-arm
platform: ubuntu-aarch64
cuda-version: "13.0.2"
artifact-name: build-artifact-ubuntu-aarch64-cuda13
cuda-sub-packages: '["cudart-dev", "nvcc", "nvrtc-dev"]'
cuda-non-cuda-packages: '["libnvjitlink-dev"]'
- os: macos-latest
platform: macos
cuda-version: ''
artifact-name: build-artifact-macos
cuda-sub-packages: ''
cuda-non-cuda-packages: ''
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Cache build artifacts
if: matrix.platform != 'macos'
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: cache-build
with:
path: warp/bin/
key: build-${{ matrix.artifact-name }}-${{ matrix.cuda-version }}-${{ hashFiles('build_lib.py', 'warp/build_dll.py', 'build_llvm.py', 'warp/native/**/*.cpp', 'warp/native/**/*.cu', 'warp/native/**/*.h', 'deps/libmathdx-deps.packman.xml') }}
- name: Install CTK (with non-CUDA packages)
if: steps.cache-build.outputs.cache-hit != 'true' && matrix.cuda-sub-packages != '' && matrix.cuda-non-cuda-packages != ''
uses: Jimver/cuda-toolkit@3d45d157f327c09c04b50ee6ccdea2d9d017ec76 # v0.2.35
with:
cuda: ${{ matrix.cuda-version }}
sub-packages: ${{ matrix.cuda-sub-packages }}
non-cuda-sub-packages: ${{ matrix.cuda-non-cuda-packages }}
method: 'network'
- name: Install CTK (without non-CUDA packages)
if: steps.cache-build.outputs.cache-hit != 'true' && matrix.cuda-sub-packages != '' && matrix.cuda-non-cuda-packages == ''
uses: Jimver/cuda-toolkit@3d45d157f327c09c04b50ee6ccdea2d9d017ec76 # v0.2.35
with:
cuda: ${{ matrix.cuda-version }}
sub-packages: ${{ matrix.cuda-sub-packages }}
method: 'network'
- name: Build Warp
if: steps.cache-build.outputs.cache-hit != 'true'
run: uv run build_lib.py
- name: Upload build artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.artifact-name }}
path: warp/bin/
retention-days: ${{ github.repository == 'NVIDIA/warp' && 7 || 1 }}
test-warp-cpu:
if: github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
runs-on: ${{ matrix.os }}
needs: build-warp
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025
platform: windows
artifact-name: build-artifact-windows-cuda12
- os: ubuntu-24.04
platform: ubuntu-x86_64
artifact-name: build-artifact-ubuntu-x86_64-cuda13
- os: ubuntu-24.04-arm
platform: ubuntu-aarch64
artifact-name: build-artifact-ubuntu-aarch64-cuda13
- os: macos-latest
platform: macos
artifact-name: build-artifact-macos
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Download Warp build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.artifact-name }}
path: warp/bin/
- name: Run Tests
run: uv run --extra dev -m warp.tests --junit-report-xml rspec.xml -s autodetect
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
if: always()
test-warp-debug:
if: github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
runs-on: ubuntu-24.04
needs: build-warp
permissions:
contents: read
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Download Warp build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifact-ubuntu-x86_64-cuda13
path: warp/bin/
- name: Run Debug Mode Tests (CPU)
run: uv run --extra dev -m warp.tests --junit-report-xml rspec.xml --suite debug --warp-debug --failfast
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
if: always()
# Compute whether the changes on a pull-request/* branch touch files relevant
# to GPU testing or to doctest. Always runs (cheap). Downstream jobs read the
# outputs to decide whether to run on PR branches; non-PR events (schedule,
# workflow_dispatch, push to main / release-* / tag) bypass these outputs via
# the dependent jobs' own `if:` blocks.
gpu-changes:
if: github.repository == 'NVIDIA/warp'
runs-on: ubuntu-latest
# Stay green for dependents on failure; combined with the `|| 'true'` fallback
# on the outputs below, this keeps PR-style branches from silently skipping
# GPU testing or doctest when the filter has a transient error.
continue-on-error: true
permissions:
contents: read
outputs:
gpu_relevant: ${{ steps.filter-gpu.outputs.any_changed || 'true' }}
docs_relevant: ${{ steps.filter-docs.outputs.any_changed || 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Fetch main for diff base
run: git fetch --depth=1 origin main
- name: Detect GPU-relevant changes
id: filter-gpu
uses: step-security/changed-files@2e07db73e5ccdb319b9a6c7766bd46d39d304bad # v47.0.5
with:
base_sha: origin/main
files: |
.github/workflows/ci.yml
.python-version
warp/**
pyproject.toml
tools/**
deps/*
build_lib.py
build_llvm.py
uv.lock
- name: Detect doctest-relevant changes
id: filter-docs
uses: step-security/changed-files@2e07db73e5ccdb319b9a6c7766bd46d39d304bad # v47.0.5
with:
base_sha: origin/main
files: docs/**
test-warp-gpu-linux:
runs-on: ${{ matrix.runner-label }}
needs: [build-warp, gpu-changes]
if: |
github.repository == 'NVIDIA/warp' && (
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release-') ||
needs.gpu-changes.outputs.gpu_relevant == 'true'
)
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- runner-label: linux-amd64-gpu-h100-latest-1
gpu-name: h100
artifact-name: build-artifact-ubuntu-x86_64-cuda13
torch-extra: torch-cu13
jax-extra: jax[cuda13]
rmm-args: ""
- runner-label: linux-amd64-gpu-rtxpro6000-latest-1
gpu-name: rtxpro6000
artifact-name: build-artifact-ubuntu-x86_64-cuda13
torch-extra: torch-cu13
jax-extra: jax[cuda13]
rmm-args: ""
- runner-label: linux-amd64-gpu-l4-earliest-1
gpu-name: l4
artifact-name: build-artifact-ubuntu-x86_64-cuda12
torch-extra: torch-cu12
jax-extra: jax[cuda12]
rmm-args: --with rmm-cu12
container:
image: ubuntu:24.04
options: -u root --security-opt seccomp=unconfined --shm-size 16g
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
timeout-minutes: 45
steps:
- name: Display GPU information
run: nvidia-smi
- name: Setup proxy cache
uses: nv-gha-runners/setup-proxy-cache@main
with:
enable-apt: true
- name: Install system dependencies
# curl and gpg are required by codecov/codecov-action@v6 to download and verify the uploader.
run: |
apt-get update
apt-get install -y git git-lfs curl gpg
git lfs install
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Download Warp build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.artifact-name }}
path: warp/bin/
- name: Run Tests
run: uv run --extra dev --extra ${{ matrix.torch-extra }} --with "${{ matrix.jax-extra }}" ${{ matrix.rmm-args }} -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
if: always()
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
continue-on-error: true # codecov upload is best-effort; do not fail the job on upload errors.
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
disable_search: true
files: ./rspec.xml
report_type: test_results
flags: test-warp-gpu-linux-${{ matrix.gpu-name }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
if: ${{ !cancelled() }}
continue-on-error: true # codecov upload is best-effort; do not fail the job on upload errors.
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
disable_search: true
files: ./coverage.xml
flags: test-warp-gpu-linux-${{ matrix.gpu-name }}
token: ${{ secrets.CODECOV_TOKEN }}
test-warp-gpu-linux-mgpu-python310:
runs-on: linux-amd64-gpu-rtxpro6000-latest-2
needs: [build-warp, gpu-changes]
if: |
github.repository == 'NVIDIA/warp' && (
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release-') ||
needs.gpu-changes.outputs.gpu_relevant == 'true'
)
permissions:
contents: read
container:
image: ubuntu:24.04
options: -u root --security-opt seccomp=unconfined --shm-size 16g
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
env:
UV_PYTHON: "3.10"
timeout-minutes: 60
steps:
- name: Display GPU information
run: nvidia-smi
- name: Setup proxy cache
uses: nv-gha-runners/setup-proxy-cache@main
with:
enable-apt: true
- name: Install system dependencies
# curl and gpg are required by codecov/codecov-action@v6 to download and verify the uploader.
run: |
apt-get update
apt-get install -y git git-lfs curl gpg
git lfs install
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Download Warp build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifact-ubuntu-x86_64-cuda13
path: warp/bin/
- name: Run Tests
run: uv run --extra dev --extra torch-cu13 --with "jax[cuda13]" -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
if: always()
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
continue-on-error: true # codecov upload is best-effort; do not fail the job on upload errors.
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
disable_search: true
files: ./rspec.xml
report_type: test_results
flags: test-warp-gpu-linux-mgpu-python310
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
if: ${{ !cancelled() }}
continue-on-error: true # codecov upload is best-effort; do not fail the job on upload errors.
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
disable_search: true
files: ./coverage.xml
flags: test-warp-gpu-linux-mgpu-python310
token: ${{ secrets.CODECOV_TOKEN }}
test-warp-gpu-windows:
runs-on: windows-amd64-gpu-rtxpro6000-latest-1
needs: [build-warp, gpu-changes]
if: |
github.repository == 'NVIDIA/warp' && (
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release-') ||
needs.gpu-changes.outputs.gpu_relevant == 'true'
)
permissions:
contents: read
timeout-minutes: 45
steps:
- name: Display GPU information
run: nvidia-smi
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Download Warp build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifact-windows-cuda13
path: warp/bin/
- name: Run Tests
# Pin usd-core to 25.5.1 to work around a frequent loading crash on Windows.
run: uv run --extra dev --extra torch-cu13 --with usd-core==25.5.1 -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
if: always()
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
continue-on-error: true # codecov upload is best-effort; do not fail the job on upload errors.
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
disable_search: true
files: ./rspec.xml
report_type: test_results
flags: test-warp-gpu-windows-rtxpro6000
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
if: ${{ !cancelled() }}
continue-on-error: true # codecov upload is best-effort; do not fail the job on upload errors.
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
disable_search: true
files: ./coverage.xml
flags: test-warp-gpu-windows-rtxpro6000
token: ${{ secrets.CODECOV_TOKEN }}
# Validate Sphinx doctests (RST testcode blocks and autodoc-extracted docstrings)
# against a real GPU. PR-style branches gate on the same filter as the GPU test
# rows, plus a docs/** filter for RST-only doctest changes.
test-warp-doctest:
runs-on: linux-amd64-gpu-l4-latest-1
needs: [build-warp, gpu-changes]
if: |
github.repository == 'NVIDIA/warp' && (
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release-') ||
needs.gpu-changes.outputs.gpu_relevant == 'true' ||
needs.gpu-changes.outputs.docs_relevant == 'true'
)
container:
image: ubuntu:24.04
options: -u root --security-opt seccomp=unconfined --shm-size 16g
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
permissions:
contents: read
timeout-minutes: 30
steps:
- name: Display GPU information
run: nvidia-smi
- name: Setup proxy cache
uses: nv-gha-runners/setup-proxy-cache@main
with:
enable-apt: true
- name: Install system dependencies
run: |
apt-get update
apt-get install -y git git-lfs
git lfs install
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
lfs: true
- name: Mark workspace as a safe git directory
# actions/checkout sets safe.directory in a temporary HOME that is
# discarded after the step. Subsequent steps that invoke git (here:
# build_docs.py invoking pre-commit) need their own persistent entry
# to avoid "dubious ownership" errors when the container runs as root.
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Download Warp build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifact-ubuntu-x86_64-cuda13
path: warp/bin/
- name: Run doctest
run: uv run --extra docs build_docs.py --doctest --no-html
build-docs:
if: github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
runs-on: ubuntu-latest
needs: build-warp
permissions:
contents: read
outputs:
artifact-url: ${{ steps.build-docs-output.outputs.artifact-url }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Download Warp binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifact-ubuntu-x86_64-cuda13
path: warp/bin/
- name: Build Sphinx documentation
run: |
uv run --extra docs build_docs.py
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
id: build-docs-output
with:
name: build-docs-output
path: |
warp/__init__.pyi
docs/api_reference
docs/language_reference
retention-days: ${{ github.repository == 'NVIDIA/warp' && 7 || 1 }}
check-build-docs-output:
if: github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
runs-on: ubuntu-latest
needs: build-docs
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Download build_docs.py output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-docs-output
path: .
- name: Check API reference docs
env:
ARTIFACT_URL: ${{ needs.build-docs.outputs.artifact-url }}
run: >
git diff --exit-code docs/api_reference docs/language_reference ||
(echo "Please run build_docs.py (or download from $ARTIFACT_URL) and add docs/api_reference and docs/language_reference to your pull request." && false)
check-unnamespaced-symbols:
if: github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
runs-on: ubuntu-latest
needs: build-warp
permissions:
contents: read
steps:
- name: Download Warp build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifact-ubuntu-x86_64-cuda13
path: warp/bin/
- name: Check for un-namespaced symbols
run: |
echo "Checking for un-namespaced symbols..."
LIBRARIES_TO_CHECK="warp/bin/warp.so warp/bin/warp-clang.so"
found_symbols=""
for lib in $LIBRARIES_TO_CHECK; do
echo "--> Checking $lib"
if [ ! -f "$lib" ]; then
echo "ERROR: $lib not found"
found_symbols="true"
continue
fi
output=$(readelf -Ws "$lib" | awk '$7 ~ /^[0-9]+$/ && $8 !~ /^(_?wp_|PyInit__warp_)/ {print $8}' | grep -Ev '^(_Z|__|\.)' || true)
if [ -n "$output" ]; then
echo "ERROR: Found un-namespaced symbols in $lib:"
echo "$output"
found_symbols="true"
fi
done
if [ -n "$found_symbols" ]; then
echo "FAIL: Un-namespaced symbols detected. Please prefix them with 'wp_' or '_wp_'."
exit 1
fi
echo "SUCCESS: All symbols are correctly namespaced."
# Validate that the type stub file (warp/__init__.pyi) passes static type checking.
type-check-stubs:
if: github.event_name != 'schedule' || github.repository == 'NVIDIA/warp'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.16"
- name: Set up Python
run: uv python install
- name: Run pyright on stub file
run: uvx pyright warp/__init__.pyi
- name: Run mypy on stub file
run: uvx mypy warp/__init__.pyi --follow-imports=silent