From fe87a39e453b64e94446181a9ae5cbfc0f62bf0c Mon Sep 17 00:00:00 2001 From: Gangzheng Tong Date: Fri, 5 Sep 2025 20:31:04 -0700 Subject: 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 Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- .github/workflows/ci-slang-test.yml | 51 ++++++++++++++++++------------------- .github/workflows/ci.yml | 2 ++ 2 files changed, 27 insertions(+), 26 deletions(-) (limited to '.github/workflows') 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: -- cgit v1.2.3