From 8f94bb18e7cd3c9532ae8ad225585aaab98717f6 Mon Sep 17 00:00:00 2001 From: TapTap Date: Sun, 15 Nov 2026 07:50:55 +0000 Subject: [PATCH] ci: bake the node and yarn toolchain into the image The web build resolves com.yarnpkg:yarn from GitHub during configuration. A run failed after two minutes with a GitHub read timeout, even though nothing in the commit touched the Wasm target. Run kotlinNodeJsSetup and kotlinYarnSetup during the image warm-up so node and yarn come from the Gradle cache in GRADLE_USER_HOME instead of a fresh GitHub download. Bump the image to audiomanager-client-ci:3. --- .gitea/workflows/ci.yaml | 4 ++-- ci/Dockerfile | 7 +++++-- scripts/build-ci-image.sh | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 68a407f..e5caa9d 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -11,7 +11,7 @@ on: env: # Built by scripts/build-ci-image.sh from ci/Dockerfile. - CI_IMAGE: gitea.tap-tap.win/taptap/audiomanager-client-ci:2 + CI_IMAGE: gitea.tap-tap.win/taptap/audiomanager-client-ci:3 jobs: build: @@ -19,7 +19,7 @@ jobs: permissions: contents: write container: - image: gitea.tap-tap.win/taptap/audiomanager-client-ci:2 + image: gitea.tap-tap.win/taptap/audiomanager-client-ci:3 steps: - uses: actions/checkout@v4 diff --git a/ci/Dockerfile b/ci/Dockerfile index 0beec1a..02d49d4 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -48,10 +48,13 @@ RUN mkdir -p "$ANDROID_HOME/cmdline-tools" \ # when dependencies change. COPY . /warmup WORKDIR /warmup -# Only warm dependencies and the common/Android/desktop compilers here. The -# Wasm executable build is memory hungry; the web job downloads node/yarn itself. +# Warm dependencies and the common/Android/desktop compilers here. The Wasm +# executable build is memory hungry and stays in the web job, but node and yarn +# are cached: Kotlin downloads them from GitHub, which has been flaky during CI. RUN sed -i 's/kotlin.daemon.jvmargs=-Xmx3g/kotlin.daemon.jvmargs=-Xmx2g/' gradle.properties \ && gradle --no-daemon --max-workers=2 \ + :kotlinNodeJsSetup \ + :kotlinYarnSetup \ :composeApp:desktopTest \ :composeApp:assembleDebug \ :composeApp:compileKotlinWasmJs \ diff --git a/scripts/build-ci-image.sh b/scripts/build-ci-image.sh index 5df6923..6e87e7d 100755 --- a/scripts/build-ci-image.sh +++ b/scripts/build-ci-image.sh @@ -6,7 +6,7 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" IMAGE="${CI_IMAGE:-gitea.tap-tap.win/taptap/audiomanager-client-ci}" -TAG="${1:-1}" +TAG="${1:-3}" docker build -f "$ROOT/ci/Dockerfile" -t "$IMAGE:$TAG" "$ROOT" docker push "$IMAGE:$TAG"