Files
AudioManagerClient/ci/Dockerfile
T
TapTap 7fb41b5ad4
CI / build (push) Successful in 1m53s
ci: cut the pipeline from 13 minutes to a single fast build
The production Wasm optimizer dominated the old run (about 10 of 13
minutes). Main/PR builds now produce the development Wasm bundle, while
the optimized bundle and desktop fat jar are built only for release tags.

Merge test and build into one job so a checkout and a Gradle run are not
repeated, and bake the Gradle dependency cache plus the Android SDK into
the CI image. Raise the version of the image to 2.
2026-11-14 19:51:11 +00:00

64 lines
2.3 KiB
Docker

# Build image for the AudioManager client pipeline.
#
# Build and push it with scripts/build-ci-image.sh after changing this file or
# the Android/Kotlin versions.
FROM gradle:8.14.3-jdk21
ARG NODE_VERSION=22.14.0
ARG ANDROID_CMDLINE_TOOLS=11076708
ENV ANDROID_HOME=/opt/android-sdk \
ANDROID_SDK_ROOT=/opt/android-sdk \
GRADLE_USER_HOME=/root/.gradle
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
python3 \
xz-utils \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*
# JavaScript actions (checkout, upload-artifact) run inside the job container.
RUN curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" \
-o /tmp/node.tar.xz \
&& tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \
&& rm /tmp/node.tar.xz \
&& node --version \
&& npm --version
RUN mkdir -p "$ANDROID_HOME/cmdline-tools" \
&& curl -fsSL "https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS}_latest.zip" \
-o /tmp/cmdline-tools.zip \
&& unzip -q /tmp/cmdline-tools.zip -d "$ANDROID_HOME/cmdline-tools" \
&& mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest" \
&& rm /tmp/cmdline-tools.zip \
&& yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null \
&& "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \
"platform-tools" \
"platforms;android-35" \
"build-tools;35.0.0" \
&& rm -rf "$ANDROID_HOME/.temp" "$ANDROID_HOME/.downloadIntermediates"
# Warm the Gradle dependency cache and the Kotlin/Wasm (node, yarn, binaryen)
# toolchain so CI jobs do not download them on every run. Rebuild this image
# 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.
RUN sed -i 's/kotlin.daemon.jvmargs=-Xmx3g/kotlin.daemon.jvmargs=-Xmx2g/' gradle.properties \
&& gradle --no-daemon --max-workers=2 \
:composeApp:desktopTest \
:composeApp:assembleDebug \
:composeApp:compileKotlinWasmJs \
--console=plain \
&& rm -rf /warmup
WORKDIR /workspace
CMD ["sleep", "infinity"]