Skip to content

Commit e8cf888

Browse files
Introduce CI container and optimize workflows
- 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.
1 parent 9699879 commit e8cf888

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

.ci/container/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ RUN mkdir -p /usr/lib/jvm && \
4646
rm /tmp/zulu8.tar.gz
4747

4848
# Install other JDKs via apt
49-
# Note: zulu25-jdk might be available. If not, this step might fail.
50-
# If it fails, we will have to adjust. But the user implies availability.
5149
RUN apt-get install -y \
5250
zulu11-jdk \
5351
zulu17-jdk \
54-
zulu21-jdk \
55-
zulu25-jdk || echo "zulu25-jdk install failed, proceeding without it"
52+
zulu21-jdk
53+
54+
# Note: zulu25-jdk might be available. If not, this step might fail.
55+
# If it fails, we will have to adjust. But the user implies availability.
56+
RUN apt-get install -y zulu25-jdk || echo "zulu25-jdk install failed, proceeding without it"
5657

5758
# Android SDK
5859
ENV ANDROID_HOME=/usr/lib/android-sdk

.github/workflows/ant.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
paths-ignore:
88
- 'CodenameOneDesigner/**'
99

10+
permissions:
11+
contents: read
12+
packages: read
13+
1014
jobs:
1115
build-linux-jdk8:
1216

.github/workflows/parparvm-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
- '!vm/**/readme.md'
1616
- '!vm/**/docs/**'
1717

18+
permissions:
19+
contents: read
20+
packages: read
21+
1822
jobs:
1923
vm-tests:
2024
runs-on: ubuntu-latest

.github/workflows/pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ permissions:
3232
contents: write
3333
pull-requests: write
3434
issues: write
35+
packages: read
3536

3637
jobs:
3738
build-test:
@@ -58,6 +59,8 @@ jobs:
5859
run: |
5960
if [ "${{ matrix.java-version }}" == "8" ]; then
6061
echo "JAVA_HOME=$JAVA8_HOME" >> $GITHUB_ENV
62+
elif [ "${{ matrix.java-version }}" == "11" ]; then
63+
echo "JAVA_HOME=$JAVA11_HOME" >> $GITHUB_ENV
6164
elif [ "${{ matrix.java-version }}" == "17" ]; then
6265
echo "JAVA_HOME=$JAVA17_HOME" >> $GITHUB_ENV
6366
elif [ "${{ matrix.java-version }}" == "21" ]; then

.github/workflows/scripts-android.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
contents: read
9090
pull-requests: write
9191
issues: write
92+
packages: read
9293
runs-on: ubuntu-latest
9394
container:
9495
image: ghcr.io/codenameone/codenameone/ci-container:latest
@@ -107,7 +108,10 @@ jobs:
107108
if: matrix.id != 'default'
108109
run: |
109110
# Map matrix.java_version to container env vars
110-
if [ "${{ matrix.java_version }}" == "17" ]; then
111+
if [ "${{ matrix.java_version }}" == "11" ]; then
112+
echo "JDK_HOME=$JAVA11_HOME" >> $GITHUB_ENV
113+
echo "JAVA_HOME=$JAVA11_HOME" >> $GITHUB_ENV
114+
elif [ "${{ matrix.java_version }}" == "17" ]; then
111115
echo "JDK_HOME=$JAVA17_HOME" >> $GITHUB_ENV
112116
echo "JAVA_HOME=$JAVA17_HOME" >> $GITHUB_ENV
113117
elif [ "${{ matrix.java_version }}" == "21" ]; then

0 commit comments

Comments
 (0)