Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

perf(ci): emsdk lands at one path, so ccache can recognise it twice

yhh673749a3254a
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0d6c74afb..08f0bb1a3 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -47,9 +47,14 @@ jobs:
- uses: ./.github/actions/setup
- name: Setup Emscripten
+ # actions-cache-folder puts emsdk at a FIXED path under the workspace. Without
+ # it the toolchain lands in $RUNNER_TEMP/<fresh uuid>/ every run, so ccache hashed
+ # a different compiler and different sysroot headers each time and never hit.
uses: mymindstorm/setup-emsdk@v16
with:
version: 5.0.0
+ actions-cache-folder: .emsdk-ci
+ cache-key: emsdk-5.0.0-${{ runner.os }}-${{ runner.arch }}
# 500M could not hold ONE generation of this job's objects: 1157 compile
# calls, 76 cleanups inside the single job, 11% hits. Sized to the measurement.
@@ -128,6 +133,8 @@ jobs:
uses: mymindstorm/setup-emsdk@v16
with:
version: 5.0.0
+ actions-cache-folder: .emsdk-ci
+ cache-key: emsdk-5.0.0-${{ runner.os }}-${{ runner.arch }}
# No size here meant the action's 500M default, and Debug+ASan objects run
# about 2.6 MB each — 193 of them filled it to 100% with 53 cleanups. One
@@ -648,6 +655,8 @@ jobs:
uses: mymindstorm/setup-emsdk@v16
with:
version: 5.0.0
+ actions-cache-folder: .emsdk-ci
+ cache-key: emsdk-5.0.0-${{ runner.os }}-${{ runner.arch }}
# The golden corpus, packaged and opened the way a player opens it, then held
# against the editor's own frame of the same game. Exporting was checked and
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index c5c77aa53..44d9a0154 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -44,6 +44,8 @@ jobs:
uses: mymindstorm/setup-emsdk@v16
with:
version: 5.0.0
+ actions-cache-folder: .emsdk-ci
+ cache-key: emsdk-5.0.0-${{ runner.os }}-${{ runner.arch }}
# Shares the key build.yml fills, so it has to agree on the ceiling —
# whichever workflow names the smallest one trims the cache back to it.
@@ -197,6 +199,8 @@ jobs:
uses: mymindstorm/setup-emsdk@v16
with:
version: 5.0.0
+ actions-cache-folder: .emsdk-ci
+ cache-key: emsdk-5.0.0-${{ runner.os }}-${{ runner.arch }}
# electron-preconditions: job-wide. play-stop-conserves and scene-churn-flat
# run the EDITOR's own check scripts, which live in the private submodule and
@@ -291,6 +295,8 @@ jobs:
uses: mymindstorm/setup-emsdk@v16
with:
version: 5.0.0
+ actions-cache-folder: .emsdk-ci
+ cache-key: emsdk-5.0.0-${{ runner.os }}-${{ runner.arch }}
# A game is packaged INTO a template, and this job never had one: the default
# path is a directory a checkout does not carry, so all 47 exports failed at
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index d80b18011..2f188b4b6 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -94,6 +94,8 @@ jobs:
uses: mymindstorm/setup-emsdk@v16
with:
version: 5.0.0
+ actions-cache-folder: .emsdk-ci
+ cache-key: emsdk-5.0.0-${{ runner.os }}-${{ runner.arch }}
# Shares the key build.yml fills, so it has to agree on the ceiling —
# whichever workflow names the smallest one trims the cache back to it.
diff --git a/.gitignore b/.gitignore
index 57f71f95c..4aa508b8e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,6 +92,10 @@ pipeline/.hotupdate-verify/
# emsdk discovery cache (per-machine path written by build-tools auto-discovery)
.emsdk-path
+# CI installs emsdk here (setup-emsdk's actions-cache-folder) so the toolchain
+# sits at one path across runs and ccache can hash it the same way twice.
+.emsdk-ci/
+
# Astro
.astro/