-
Notifications
You must be signed in to change notification settings - Fork 433
Introduce CI container and optimize workflows #4310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce CI container and optimize workflows #4310
Conversation
- Added `.ci/container/Dockerfile` based on Ubuntu 24.04 with Java 8-25, Android SDK, and build tools. - Added `.github/workflows/build-container.yml` to build and push the container image. - Updated `.github/workflows/pr.yml`, `ant.yml`, `scripts-android.yml`, `parparvm-tests.yml` to use the new container. - Updated `scripts/setup-workspace.sh` to respect `CN1_BINARIES` and skip updates if needed. - Optimized dependencies installation by using pre-installed tools in the container.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
- Added `.ci/container/Dockerfile` based on Ubuntu 24.04 with Java 8-25, Android SDK, and build tools. - Added `.github/workflows/build-container.yml` to build and push the container image. - Updated `.github/workflows/pr.yml`, `ant.yml`, `scripts-android.yml`, `parparvm-tests.yml` to use the new container. - Updated `scripts/setup-workspace.sh` to respect `CN1_BINARIES` and skip updates if needed. - Optimized dependencies installation by using pre-installed tools in the container.
- Added `.ci/container/Dockerfile` based on Ubuntu 24.04 with Java 8-25, Android SDK, and build tools. - Added `.github/workflows/build-container.yml` to build and push the container image. - Updated `.github/workflows/pr.yml`, `ant.yml`, `scripts-android.yml`, `parparvm-tests.yml` to use the new container. - Updated `scripts/setup-workspace.sh` to respect `CN1_BINARIES` and skip updates if needed. - Optimized dependencies installation by using pre-installed tools in the container.
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
- Changed Android SDK installation location to `/opt/android/sdk` to avoid `AndroidGradleBuilder` path resolution issues which occur when `ANDROID_HOME` name is not "sdk". - Set `ANDROID_HOME` to `/opt/android/sdk`. - Updated `.ci/container/Dockerfile` accordingly. - Added `packages: read` permissions to CI workflows to allow pulling the container image. - Separated Java 25 installation to allow failure without breaking the entire build. - Added Java 11 support to workflows.
- Replaced non-ASCII arrow character in `AndroidScreenshotTask.java` with ASCII "->" to fix compilation error. - Updated `Ports/Android/build.xml` to explicitly use `encoding="UTF-8"` for `javac` tasks. - Updated `.ci/container/Dockerfile` to generate and enforce `en_US.UTF-8` locale in the build container.
- Replaced non-ASCII arrow character in `AndroidScreenshotTask.java` with ASCII "->" to fix compilation error. - Updated `Ports/Android/build.xml` to explicitly use `encoding="UTF-8"` for `javac` tasks. - Updated `.ci/container/Dockerfile` to generate and enforce `en_US.UTF-8` locale in the build container.
Updated `AndroidGradleBuilder.java` to improve SDK path detection. Instead of assuming any `ANDROID_HOME` path that doesn't end in "sdk" must be a parent directory, the builder now validates the directory content (checking for `platform-tools`, `build-tools`, etc.) before modifying the path. This change ensures compatibility with the new CI container layout where `ANDROID_HOME` points directly to the SDK root at `/opt/android-sdk` (or `/opt/android/sdk`) without forcing an incorrect `/sdk` suffix.
Updated CI workflows to use a unified Docker container with pre-installed dependencies. Addressed build failures related to Android SDK tools requiring newer Java versions and fixed Maven plugin dependencies.
- **CI Containerization:**
- Created `.ci/container/Dockerfile` based on Ubuntu 24.04 with OpenJDK 8-25, Android SDK, Ant, Maven, and Python.
- Updated `pr.yml`, `ant.yml`, `scripts-android.yml`, and `parparvm-tests.yml` to run inside the container.
- Added `build-container.yml` workflow to build and push the container image.
- **Fix Android Build:**
- Modified `AndroidGradleBuilder.java` to set `JAVA_HOME` to Java 17/11 (if available) for spawned processes, ensuring `sdkmanager` runs correctly.
- Updated `scripts/run-android-instrumentation-tests.sh` to explicitly use `JAVA17_HOME` for `sdkmanager`.
- Improved `AndroidGradleBuilder` SDK path detection to support standard paths like `/opt/android-sdk`.
- **Fix Maven Plugin:**
- Added `xalan` and `serializer` dependencies to `maven/codenameone-maven-plugin/pom.xml` to resolve `NoClassDefFoundError` during CSS compilation.
- **Encoding Fixes:**
- Enforced UTF-8 encoding in `Ports/Android/build.xml` and fixed a non-ASCII character in source code.
- **Android CI:** - Updated `.github/workflows/scripts-android.yml` to explicitly set `JAVA_HOME` to Java 17 for the `reactivecircus/android-emulator-runner` step. This resolves `UnsupportedClassVersionError` in `sdkmanager` (which requires Java 17+), ensuring the Android SDK and emulator are correctly initialized within the CI container (where the default `JAVA_HOME` is Java 8). - **Maven Plugin:** - Modified `maven/codenameone-maven-plugin/pom.xml` to move `xalan` and `serializer` dependencies to the top of the dependency list. This prioritizes them on the classpath over `codenameone-designer` (a fat jar), resolving a `NoClassDefFoundError: org/apache/xml/serializer/OutputPropertiesFactory` that occurred during CSS compilation in archetype integration tests.
- **Fix `setup-workspace.sh`:** Updated logic to correctly skip `cn1-binaries` update when `CN1_SKIP_BINARIES_UPDATE=1` is set, preventing accidental deletion of the pre-installed repository in the CI container.
- **Fix Android Workflow:**
- Explicitly set `CN1_BINARIES` and `MAVEN_HOME` env vars in `scripts-android.yml` to utilize pre-installed tools in the container, saving disk space and time.
- Added `disk-size: 4096M` to the emulator runner configuration to constrain the userdata partition size, resolving "Not enough space to create userdata partition" errors on standard runners.
Android screenshot updatesCompared 30 screenshots: 29 matched, 1 updated.
Native Android coverage
|







This PR introduces a Docker container for CI workflows to standardize the build environment and speed up execution by pre-installing dependencies.
Changes:
.ci/containerthat includes:cn1-binariesrepo cloned to/opt/cn1-binaries.build-container.ymlto build and push the image to GHCR.pr.ymlto run in the container, removing manual JDK setup andcn1-binariescloning.ant.ymlto run in the container.scripts-android.ymlto run in the container (privileged mode for KVM).parparvm-tests.ymlto run in the container and map environment variables.scripts/setup-workspace.shto respectCN1_BINARIESenvironment variable (set in container) and allow skipping git updates viaCN1_SKIP_BINARIES_UPDATE.Note: The workflows in this PR will fail until the container image is successfully built and pushed to
ghcr.io/codenameone/codenameone/ci-container:latest. This requires merging the PR or manually triggering the build workflow if permissions allow.PR created automatically by Jules for task 8659650574294850933 started by @shai-almog