Skip to content

Commit 3b5e579

Browse files
Optimize CI by using a custom Docker container with pre-installed dependencies.
This change introduces a Docker container (`.ci/container/Dockerfile`) that pre-installs: - OpenJDK 8 (ZuluFX), 11, 17, 21, and 25 (Zulu). - Android SDK (command-line tools, platform-tools, build-tools) and NDK dependencies. - Ant, Maven, Python 3. - Codename One binaries (`cn1-binaries`). - Required libraries for headless UI testing (xvfb, libgl1-mesa-dri, libncurses6). Updates `pr.yml`, `ant.yml`, and `scripts-android.yml` to run jobs inside this container (`ghcr.io/codenameone/codenameone/ci-container:latest`), removing redundant setup steps (JDK download, tool installation) to improve build speed and reproducibility. The workflow `.github/workflows/build-container.yml` is added to build and push this container image to GHCR, ensuring the image tag is always lowercase to comply with registry requirements. Also updates `scripts/setup-workspace.sh` to respect the `CN1_BINARIES` environment variable and handle the pre-configured environment correctly.
1 parent a1c5ce7 commit 3b5e579

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.ci/container/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ ENV PATH=${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools
7373

7474
# Accept licenses and install packages
7575
# Note: sdkmanager requires Java 11+ to run. We use JAVA17_HOME for this step.
76-
RUN yes | JAVA_HOME=${JAVA17_HOME} sdkmanager --licenses && \
77-
JAVA_HOME=${JAVA17_HOME} sdkmanager "platform-tools" "platforms;android-31" "build-tools;31.0.0"
76+
# We dynamically locate Zulu 17 to ensure the correct path is used.
77+
RUN export JAVA17_REAL=$(find /usr/lib/jvm -maxdepth 1 -name "zulu*17*" -type d | head -n 1) && \
78+
echo "Using JDK 17 at: $JAVA17_REAL" && \
79+
yes | JAVA_HOME=$JAVA17_REAL sdkmanager --licenses && \
80+
JAVA_HOME=$JAVA17_REAL sdkmanager "platform-tools" "platforms;android-31" "build-tools;31.0.0"
7881

7982
# Set Default JAVA_HOME to Java 8 (as per user requirement for builds)
8083
ENV JAVA_HOME=/usr/lib/jvm/zulu8-fx

0 commit comments

Comments
 (0)