Skip to content

Commit d9de952

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. Explicit `packages: read` permissions are added to `pr.yml`, `ant.yml`, and `scripts-android.yml` to allow pulling the CI container from GHCR. The `pr.yml` workflow now defaults to `bash` shell to support `pipefail`. The `scripts-android.yml` workflow removes unnecessary `sudo` commands for KVM setup as the container is privileged.
1 parent 167f481 commit d9de952

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

.github/workflows/pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
runs-on: ubuntu-latest
4141
container:
4242
image: ghcr.io/codenameone/codenameone/ci-container:latest
43+
defaults:
44+
run:
45+
shell: bash
4346

4447
steps:
4548
- uses: actions/checkout@v1

.github/workflows/scripts-android.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ jobs:
118118
- name: Build Hello Codename One Android app
119119
id: build-android-app
120120
run: ./scripts/build-android-app.sh -q -DskipTests
121-
- name: Enable KVM for Android emulator
122-
run: |
123-
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
124-
sudo udevadm control --reload-rules
125-
sudo udevadm trigger --name-match=kvm
126121
- name: Run Android instrumentation tests
127122
uses: reactivecircus/android-emulator-runner@v2
128123
with:

0 commit comments

Comments
 (0)