diff options
| author | Gangzheng Tong <tonggangzheng@gmail.com> | 2025-09-04 13:08:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-04 13:08:53 -0700 |
| commit | 0fb62524bc8beda70694f6c58570ad8096bbe698 (patch) | |
| tree | 0e835def4cae1211975b8f8b49aea0082faf50d6 /.github/actions/common-setup | |
| parent | 20373ad01d09d46646d4de0a8cc7a78a4c8f6638 (diff) | |
Split CI to build and test jobs (#8359)
The CI has been re-organized with the following:
```
ci.yml (Main Orchestrator)
├── filter job
│ ├── Documentation Only? → Yes → Skip CI
│ └── Documentation Only? → No → Continue CI
│
├── Build Jobs
│ └── ci-slang-build.yml
│ ├── common-setup action
│ ├── Build & Package
│ └── Upload Artifacts (Build package and Tests package)
│
└── Test Jobs
└── ci-slang-test.yml
└── common-test-setup action
├── Download Tests Artifacts ← (from Build)
└── Run Tests
```
To achieve fine-grained build->test dependency, instead of using `matrix
strategy` in single build (or single test) job, the main ci.yml
statically defines the each config of the build and test job.
e.g. `build-windows-debug-cl-x86_64-gpu` and
`test-windows-debug-cl-x86_64-gpu` are a pair of the build-test job for
the windows/debug/ci config.
Closes: https://github.com/shader-slang/slang/issues/6728
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to '.github/actions/common-setup')
| -rw-r--r-- | .github/actions/common-setup/action.yml | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index f2e9567dd..1ab2d1a48 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -28,6 +28,20 @@ runs: with: sdk: "10.0.19041.0" + - name: Install dependencies (Linux only) + shell: bash + run: | + if [[ "${{ inputs.os }}" == "linux" ]]; then + sudo apt-get update + sudo apt-get install -y libx11-dev + fi + + - name: Setup Node.js (Linux only) + if: inputs.os == 'linux' + uses: actions/setup-node@v4 + with: + node-version: "20.x" + - shell: bash run: | # Set up system dependencies @@ -84,7 +98,7 @@ runs: id: cache-llvm if: inputs.build-llvm == 'true' with: - path: ${{ github.workspace }}/build/llvm-project-install + path: build/llvm-project-install # Use os*compiler*platform in lieu of an ABI key here, which is what we really want key: llvm-${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.platform }}-${{ hashFiles('external/build-llvm.sh') }} - name: Build LLVM @@ -97,7 +111,7 @@ runs: - uses: actions/cache/save@v4 if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true' with: - path: ${{ github.workspace }}/build/llvm-project-install + path: build/llvm-project-install key: ${{ steps.cache-llvm.outputs.cache-primary-key }} - name: Set environment variable for CMake @@ -133,12 +147,15 @@ runs: exit 0 fi - echo "✅ ccache found on self-hosted runner - setting up local caching" + echo "✅ ccache found on self-hosted runner - setting up persistent caching" - # Set ccache directory (local temp directory) - ccache_dir="${{ github.workspace }}/.ccache-local" + # Set ccache directory to a persistent location outside workspace + # Use runner temp directory with a unique path per repo/compiler/platform + ccache_base_dir="${RUNNER_TEMP:-/tmp}/ccache-slang" + ccache_dir="$ccache_base_dir/${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.platform }}" mkdir -p "$ccache_dir" echo "CCACHE_DIR=$ccache_dir" >> $GITHUB_ENV + echo "🔧 Using persistent ccache directory: $ccache_dir" # Configure ccache settings for local use only ccache --set-config=max_size=2G @@ -147,7 +164,9 @@ runs: ccache --set-config=sloppiness=pch_defines,time_macros # Enable ccache for CMake (set environment variables) - echo "ccache_symlinks_path=ccache" >> $GITHUB_ENV + # Get the full path to ccache executable + ccache_path=$(which ccache) + echo "ccache_symlinks_path=$ccache_path" >> $GITHUB_ENV # Show initial stats echo "ccache configuration:" |
