summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGangzheng Tong <tonggangzheng@gmail.com>2025-09-05 20:31:04 -0700
committerGitHub <noreply@github.com>2025-09-05 20:31:04 -0700
commitfe87a39e453b64e94446181a9ae5cbfc0f62bf0c (patch)
tree590faeefb6a5e31726b3b0afc9ec71464d46b8d4
parent4856da26e188c28bf691d0210ce8016264c00940 (diff)
Remove unnecessary check and adust server count etc. in CI (#8374)
- This PR removes "wasm" check from the test job, since there is no test job for "wasm" yet. - Also, move the check for slang-rhi and slangpy test to the job level to skip the setup etc. if no run is needed. - Update the macos compiler version in building.md to match the clang compiler used in CI. - Reduce the server count in Linux and Mac when running slang-test to ease the machine load - Run slangpy test with `-n auto --maxprocesses=4` to speed up --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
-rw-r--r--.github/actions/common-test-setup/action.yml61
-rw-r--r--.github/workflows/ci-slang-test.yml51
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--docs/building.md2
4 files changed, 74 insertions, 42 deletions
diff --git a/.github/actions/common-test-setup/action.yml b/.github/actions/common-test-setup/action.yml
index ab1a665c7..3fc6dd617 100644
--- a/.github/actions/common-test-setup/action.yml
+++ b/.github/actions/common-test-setup/action.yml
@@ -40,13 +40,8 @@ runs:
chmod +x github_artifact/${cmake_config}/bin/* 2>/dev/null || echo "No executables to make executable"
# Set up bin_dir based on platform and config
- if [[ "${{ inputs.platform }}" == "wasm" ]]; then
- bin_dir=build.em/Release/bin
- echo "bin_dir=$bin_dir" >> $GITHUB_ENV
- else
- bin_dir=$(pwd)/github_artifact/${cmake_config}/bin
- echo "bin_dir=$bin_dir" >> $GITHUB_ENV
- fi
+ bin_dir=$(pwd)/github_artifact/${cmake_config}/bin
+ echo "bin_dir=$bin_dir" >> $GITHUB_ENV
# Also set lib_dir for slangpy tests
lib_dir=$(pwd)/github_artifact/${cmake_config}/lib
@@ -61,21 +56,57 @@ runs:
# On Windows, DLLs should be in the same directory as executables or in PATH
# Use $GITHUB_PATH instead of $PATH for preservation across steps and
# avoid unix-like/windows-like path issues
- echo "$bin_dir" >> $GITHUB_PATH
- echo "$lib_dir" >> $GITHUB_PATH
+ # echo "$bin_dir" >> $GITHUB_PATH
+ # echo "$lib_dir" >> $GITHUB_PATH
+ echo "skipping setting PATH in Windows"
fi
+ # List directory contents
+ echo "Contents of bin_dir ($bin_dir):"
+ ls -a "$bin_dir" 2>/dev/null || echo "bin_dir not found"
+ echo "Contents of lib_dir ($lib_dir):"
+ ls -a "$lib_dir" 2>/dev/null || echo "lib_dir not found"
+
- name: Check runtime environment
- if: inputs.platform != 'wasm'
shell: bash
run: |
- echo "$bin_dir/slang-test"
- "$bin_dir/slang-test" tests/render/check-backend-support-on-ci.slang
- smokeResult=$("$bin_dir/slang-test" tests/render/check-backend-support-on-ci.slang)
+ echo "Checking supported backends"
+ # Capture the output of slang-test while also displaying it
+ if ! smokeResult=$("$bin_dir/slang-test" tests/render/check-backend-support-on-ci.slang 2>&1); then
+ echo "❌ ERROR: slang-test failed to run"
+ echo "Output: $smokeResult"
+ exit 1
+ fi
supportedBackends="$(echo "$smokeResult" | grep 'Supported backends: ')"
+ echo "$smokeResult"
echo "$supportedBackends"
- # Windows-specific version checks - fail if tools are not available
- if [[ "${{ inputs.os }}" == "windows" ]]; then
+
+ # Check if the output contains "llvm" (case-insensitive)
+ if echo "$supportedBackends" | grep -qi "llvm"; then
+ echo "✅ LLVM backend support detected"
+ else
+ echo "❌ ERROR: LLVM backend support not detected - this is required to run the filecheck!"
+ fi
+
+ # Function to check API support
+ check_api_support() {
+ local api_list=("$@")
+ for api in "${api_list[@]}"; do
+ if echo "$smokeResult" | grep -qi "${api}: Supported"; then
+ echo "✅ ${api} API support detected"
+ else
+ echo "❌ ${api} API support not detected"
+ exit 1
+ fi
+ done
+ }
+
+ # Platform-specific API checks - fail if APIs are not available
+ if [[ "${{ inputs.os }}" == "macos" ]]; then
+ check_api_support "mtl,metal"
+ elif [[ "${{ inputs.os }}" == "windows" ]]; then
+ check_api_support "vk,vulkan" "dx12,d3d12" "dx11,d3d11" "cuda"
+
echo "Printing CUDA compiler version: ..."
nvcc --version || (echo "ERROR: CUDA compiler (nvcc) not available on Windows" && exit 1)
echo "Printing GPU driver version: ..."
diff --git a/.github/workflows/ci-slang-test.yml b/.github/workflows/ci-slang-test.yml
index 9c6dabf34..4e4a880d9 100644
--- a/.github/workflows/ci-slang-test.yml
+++ b/.github/workflows/ci-slang-test.yml
@@ -44,9 +44,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- with:
- submodules: "recursive"
- fetch-depth: "2"
- name: Common Test Setup
uses: ./.github/actions/common-test-setup
@@ -57,7 +54,6 @@ jobs:
config: ${{ inputs.config }}
- name: Test Slang
- if: inputs.platform != 'wasm'
run: |
export SLANG_RUN_SPIRV_VALIDATION=1
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -84,7 +80,7 @@ jobs:
"$bin_dir/slang-test" "${slang_test_args[@]}"
- name: Run Slang examples
# Run GLSL backend tests on release for pull requests, and not on merge_group, to reduce CI load.
- if: inputs.platform != 'wasm' && inputs.full-gpu-tests && inputs.config == 'release' && github.event_name == 'pull_request'
+ if: inputs.full-gpu-tests && inputs.config == 'release' && github.event_name == 'pull_request'
run: |
.github/workflows/ci-examples.sh \
--bin-dir "$bin_dir" \
@@ -93,12 +89,11 @@ jobs:
--config "${{ inputs.config }}" \
--skip-file tests/expected-example-failure-github.txt
- name: Run slangc tests
- if: inputs.platform != 'wasm'
run: |
PATH=$bin_dir:$PATH tools/slangc-test/test.sh
- name: Test Slang via glsl
# Run GLSL backend tests on release for pull requests, and not on merge_group, to reduce CI load.
- if: inputs.platform != 'wasm' && inputs.os != 'macos' && inputs.full-gpu-tests && inputs.config == 'release' && github.event_name == 'pull_request'
+ if: inputs.os != 'macos' && inputs.full-gpu-tests && inputs.config == 'release' && github.event_name == 'pull_request'
run: |
export SLANG_RUN_SPIRV_VALIDATION=1
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
@@ -112,8 +107,14 @@ jobs:
-skip-reference-image-generation \
-show-adapter-info
+ # Run slang-rhi tests when:
+ # 1. full-gpu-tests is enabled AND
+ # 2. Either it's a pull request OR config is release
+ # This is to reduce the CI load but do some check on pull requests.
+ # expensive slang-rhi tests are excluded with -tce option, because they are not relevant for Slang.
test-slang-rhi:
runs-on: ${{ fromJSON(inputs.runs-on) }}
+ if: inputs.full-gpu-tests && (github.event_name == 'pull_request' || inputs.config == 'release')
defaults:
run:
shell: bash
@@ -122,7 +123,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- fetch-depth: "2"
+ fetch-depth: "1"
- name: Common Test Setup
uses: ./.github/actions/common-test-setup
@@ -133,9 +134,6 @@ jobs:
config: ${{ inputs.config }}
- name: Run slang-rhi tests
- # Run slang-rhi tests on debug+release for pull requests, and only on release for merge_group, to reduce CI load.
- # Some of the expensive tests that are not relevant for Slang (because they just test graphics API related things) are excluded using -tce.
- if: inputs.platform != 'wasm' && inputs.full-gpu-tests && (github.event_name == 'pull_request' || inputs.config == 'release')
run: |
export SLANG_RHI_EXCLUDE_TESTS="md-clear*,cmd-copy*,cmd-upload*,fence*,staging-heap*,texture-create*"
if [[ "${{ inputs.os }}" == "macos" ]]; then
@@ -143,8 +141,13 @@ jobs:
fi
"$bin_dir/slang-rhi-tests" -check-devices -tce="$SLANG_RHI_EXCLUDE_TESTS"
+ # Run slangpy tests when:
+ # 1. full-gpu-tests is enabled AND
+ # 2. Either it's a pull request OR config is release
+ # This is to reduce the CI load but do some check on pull requests.
test-slangpy:
runs-on: ${{ fromJSON(inputs.runs-on) }}
+ if: inputs.full-gpu-tests && (github.event_name == 'pull_request' || inputs.config == 'release')
defaults:
run:
shell: bash
@@ -153,7 +156,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- fetch-depth: "2"
+ fetch-depth: "1"
- name: Common Test Setup
uses: ./.github/actions/common-test-setup
@@ -164,8 +167,6 @@ jobs:
config: ${{ inputs.config }}
- name: Run slangpy tests
- # Run slangpy tests on debug+release for pull requests, and only on release for merge_group, to reduce CI load.
- if: inputs.platform != 'wasm' && inputs.full-gpu-tests && (github.event_name == 'pull_request' || inputs.config == 'release')
run: |
python --version
echo "Cleaning up existing installations and installing slangpy..."
@@ -191,21 +192,19 @@ jobs:
echo "Listing files in slangpy directory..."
ls -la "$SITE_PACKAGES/slangpy/"
- echo "Installing python packages..."
-
- # Only install additional packages on GitHub-hosted runners, not self-hosted
- if [[ "${{ inputs.runs-on }}" != *"self-hosted"* ]]; then
- # Download and install requirements from slangpy repository
- echo "Fetching requirements-dev.txt from slangpy repository..."
+ # Skip package installation on self-hosted runners to avoid permission issues
+ if [[ ! "${{ inputs.runs-on }}" =~ self-hosted ]]; then
+ echo "Installing python packages..."
curl -fsSL https://raw.githubusercontent.com/shader-slang/slangpy/main/requirements-dev.txt -o requirements-dev.txt
-
- echo "Installing development requirements..."
- python -m pip install -r requirements-dev.txt
- python -m pip install pytest-github-actions-annotate-failures
+ python -m pip install -r requirements-dev.txt --user
+ python -m pip install pytest-github-actions-annotate-failures --user
+ python -m pip install pytest-xdist --user
else
- echo "Skipping additional package installation on self-hosted runner"
+ echo "Skipping Python package installation on self-hosted runner"
+ # TODO: remove this once we have pytest-xdist installed on all self-hosted runners
+ python -m pip install pytest-xdist --user
fi
echo "Running pytest on slangpy tests..."
export PYTHONPATH="$SITE_PACKAGES"
- python -m pytest "$SITE_PACKAGES/slangpy/tests" -ra
+ python -m pytest "$SITE_PACKAGES/slangpy/tests" -ra -n auto --maxprocesses=4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 61ed00769..cbf5fe77e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -135,6 +135,7 @@ jobs:
config: debug
runs-on: '["ubuntu-22.04"]'
test-category: smoke
+ server-count: 2
test-linux-release-gcc-x86_64:
needs: [filter, build-linux-release-gcc-x86_64]
@@ -147,6 +148,7 @@ jobs:
config: release
runs-on: '["ubuntu-22.04"]'
test-category: full
+ server-count: 4
# macOS tests
test-macos-debug-clang-aarch64:
diff --git a/docs/building.md b/docs/building.md
index b6e18ad25..bcf366d51 100644
--- a/docs/building.md
+++ b/docs/building.md
@@ -353,7 +353,7 @@ encouraged but it isn't a continuously maintained setup.
_MSVC_ 19 is tested in CI and is the recommended minimum version.
-_Clang_ 15.0 is tested in CI and is the recommended minimum version.
+_Clang_ 17.0 is tested in CI and is the recommended minimum version.
## Static linking against libslang