Skip to content

Commit a1c5ce7

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 dac49bf commit a1c5ce7

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

.ci/container/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN apt-get update && apt-get install -y \
1919
libxxf86vm1 \
2020
ant \
2121
maven \
22-
libncurses5 \
22+
libncurses6 \
2323
libstdc++6 \
2424
&& rm -rf /var/lib/apt/lists/*
2525

.github/workflows/pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ jobs:
203203
script: |
204204
const { publishQualityComment } = require('./.github/scripts/publish-quality-comment.js');
205205
await publishQualityComment({ github, context, core });
206+
- name: Link cn1-binaries
207+
run: |
208+
ln -sf $CN1_BINARIES ../cn1-binaries
206209
- name: Build with Ant
207210
run: xvfb-run ant test-javase
208211
- name: Build CLDC11 JAR

.github/workflows/scripts-android.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ jobs:
9898
GH_TOKEN: ${{ secrets.CN1SS_GH_TOKEN }}
9999
steps:
100100
- uses: actions/checkout@v4
101-
- name: Free Disk Space
102-
if: matrix.id != 'default'
103-
run: |
104-
rm -rf /usr/share/dotnet
105-
rm -rf /usr/local/lib/android/sdk/ndk
106-
rm -rf /opt/ghc
107-
rm -rf /usr/share/swift
108101
- name: Set JDK_HOME
109102
if: matrix.id != 'default'
110103
run: echo "JDK_HOME=/usr/lib/jvm/zulu-${{ matrix.java_version }}-amd64" >> $GITHUB_ENV

0 commit comments

Comments
 (0)