summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
authorGangzheng Tong <tonggangzheng@gmail.com>2025-09-02 17:07:06 -0700
committerGitHub <noreply@github.com>2025-09-03 00:07:06 +0000
commit7d15d388d7e92547f1cc8ca47748b79589701051 (patch)
tree457312d7278eb8aa5186ca03237477b3f3ad5993 /.github/workflows/ci.yml
parentf02b08490aa905f42a8d90381db84b1f8e409c0c (diff)
Enable ccache for self-hosted runner (#8345)
Related to 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/workflows/ci.yml')
-rw-r--r--.github/workflows/ci.yml20
1 files changed, 16 insertions, 4 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6468a15af..2886821af 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -183,6 +183,8 @@ jobs:
if: steps.filter.outputs.should-run == 'true'
run: |
echo "cmake version: $(cmake --version)"
+
+
if [[ "${{ matrix.platform }}" = "wasm" ]]; then
git clone https://github.com/emscripten-core/emsdk.git
pushd emsdk
@@ -202,7 +204,14 @@ jobs:
[ -f "slang-wasm.js" ]
node smoke/smoke-test.js smoke/rand_float.slang computeMain
else
- if [[ "${{ matrix.os }}" =~ "windows" && "${{ matrix.config }}" != "release" && "${{ matrix.config }}" != "releaseWithDebugInfo" ]]; then
+ # Set up ccache launcher arguments if ccache is available (self-hosted runners)
+ cmake_launcher_defines=()
+ if [[ -n "${{ env.ccache_symlinks_path }}" ]]; then
+ cmake_launcher_defines+=("-DCMAKE_C_COMPILER_LAUNCHER=${{ env.ccache_symlinks_path }}")
+ cmake_launcher_defines+=("-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.ccache_symlinks_path }}")
+ fi
+
+ if [[ "${{ matrix.os }}" =~ "windows" && "${{ matrix.config }}" == "debug" ]]; then
# Doing a debug build will try to link against a release built llvm, this
# is a problem on Windows, so make slang-llvm in release build and use
# that as though it's a fetched binary via these presets.
@@ -211,20 +220,23 @@ jobs:
cmake --preset default --fresh \
-DSLANG_SLANG_LLVM_FLAVOR=FETCH_BINARY \
"-DSLANG_SLANG_LLVM_BINARY_URL=$(pwd)/build/dist-release/slang-llvm.zip" \
- "-DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}}"
+ "-DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}}" \
+ "${cmake_launcher_defines[@]}"
cmake --workflow --preset "${{matrix.config}}"
elif [[ "${{ matrix.build-llvm }}" = "false" ]]; then
# linux aarch64 cannot build llvm.
cmake --preset default --fresh \
-DSLANG_SLANG_LLVM_FLAVOR=DISABLE \
- -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}}
+ -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \
+ "${cmake_launcher_defines[@]}"
cmake --workflow --preset "${{matrix.config}}"
else
# Otherwise, use the "system" llvm we have just build or got from the
# cache in the setup phase
cmake --preset default --fresh \
-DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM \
- -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}}
+ -DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}} \
+ "${cmake_launcher_defines[@]}"
cmake --workflow --preset "${{matrix.config}}"
fi
fi