summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/actions/common-setup/action.yml15
-rw-r--r--.github/workflows/ci.yml20
2 files changed, 31 insertions, 4 deletions
diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml
index a3b219c15..bf6174c75 100644
--- a/.github/actions/common-setup/action.yml
+++ b/.github/actions/common-setup/action.yml
@@ -117,3 +117,18 @@ runs:
windows*) echo "${{github.workspace}}/external/slang-binaries/spirv-tools/windows-$win_platform/bin" >> "$GITHUB_PATH";;
linux*) echo "${{github.workspace}}/external/slang-binaries/spirv-tools/$(uname -m)-linux/bin" >> "$GITHUB_PATH";;
esac
+
+ # Setup ccache for self-hosted runners (Windows only for now)
+ - name: Setup ccache
+ if: ${{ inputs.os == 'windows' && runner.environment == 'self-hosted' }}
+ uses: Chocobo1/setup-ccache-action@v1
+ with:
+ update_packager_index: false
+ install_ccache: true
+ prepend_symlinks_to_path: true
+ windows_compile_environment: msvc
+ ccache_options: |
+ max_size=2G
+ compression=true
+ compression_level=6
+ sloppiness=pch_defines,time_macros
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