Skip to content

Commit 8e892e2

Browse files
Add CI testing for slangpy-samples (#8938)
Adds testing for the [slangpy-samples](https://github.com/shader-slang/slangpy-samples) repository to provide integration testing of slangpy with real-world examples. # Implementation The `test-slangpy` job now includes slangpy-samples testing alongside the existing slangpy pytest tests. After running slangpy's own tests, the job: 1. Clones the `slangpy-samples` repository 2. Installs dependencies from `requirements.txt` 3. Runs `pytest -n 4 slangpy-samples/tests` (parallel execution with 4 workers) The implementation follows the [original issue's preferred solution](#8186 (comment)). # When It Runs Same conditions as the main slangpy tests, ensuring we test integration examples alongside the core slangpy functionality. Fixes #8186
1 parent 7e4a89b commit 8e892e2

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

.github/workflows/ci-slang-test.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,11 @@ jobs:
155155
run: |
156156
"$bin_dir/slang-rhi-tests" -check-devices -optix-version=80100 -tc="ray-tracing-*.cuda"
157157
158-
# Run slangpy tests when:
158+
# Run slangpy tests and examples when:
159159
# 1. full-gpu-tests is enabled AND
160160
# 2. Either it's a pull request OR config is release
161161
# This is to reduce the CI load but do some check on pull requests.
162+
# Includes both slangpy pytest tests and slangpy-samples examples.
162163
test-slangpy:
163164
runs-on: ${{ fromJSON(inputs.runs-on) }}
164165
timeout-minutes: 30
@@ -231,15 +232,30 @@ jobs:
231232
echo "Listing files in slangpy directory..."
232233
ls -la "$SITE_PACKAGES/slangpy/"
233234
234-
# Skip package installation on self-hosted runners to avoid permission issues
235-
if [[ ! "${{ inputs.runs-on }}" =~ self-hosted ]]; then
236-
echo "Installing python packages..."
237-
curl -fsSL https://raw.githubusercontent.com/shader-slang/slangpy/main/requirements-dev.txt -o requirements-dev.txt
238-
python -m pip install -r requirements-dev.txt --user
239-
python -m pip install pytest-github-actions-annotate-failures --user
240-
python -m pip install pytest-xdist --user
241-
fi
235+
# Export SITE_PACKAGES for use in slangpy-samples step
236+
echo "SITE_PACKAGES=$SITE_PACKAGES" >> $GITHUB_ENV
237+
238+
echo "Installing python packages..."
239+
curl -fsSL https://raw.githubusercontent.com/shader-slang/slangpy/main/requirements-dev.txt -o requirements-dev.txt
240+
python -m pip install -r requirements-dev.txt --user
241+
python -m pip install pytest-github-actions-annotate-failures --user
242+
python -m pip install pytest-xdist --user
242243
243244
echo "Running pytest on slangpy tests..."
244245
export PYTHONPATH="$SITE_PACKAGES"
245246
python -m pytest "$SITE_PACKAGES/slangpy/tests" -ra -n auto --maxprocesses=3
247+
248+
- name: Clone slangpy-samples
249+
run: |
250+
echo "Cloning slangpy-samples repository..."
251+
git clone --depth 1 https://github.com/shader-slang/slangpy-samples.git
252+
253+
- name: Install slangpy-samples dependencies
254+
run: |
255+
echo "Installing slangpy-samples dependencies..."
256+
python -m pip install -r slangpy-samples/requirements.txt --user
257+
258+
- name: Run slangpy-samples tests
259+
run: |
260+
echo "Running slangpy-samples tests..."
261+
python -m pytest -n 4 slangpy-samples/tests

0 commit comments

Comments
 (0)