-
Notifications
You must be signed in to change notification settings - Fork 434
Introduce CI Container and Optimize Workflows #4308
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
Closed
google-labs-jules
wants to merge
12
commits into
master
from
feature/ci-container-optimization-15610411111039306208
Closed
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
02892ab
Updated ant build
shai-almog 2a517c4
Updated target versions
shai-almog 8f96d66
Optimize CI by using a custom Docker container with pre-installed dep…
google-labs-jules[bot] dac49bf
Optimize CI by using a custom Docker container with pre-installed dep…
google-labs-jules[bot] a1c5ce7
Optimize CI by using a custom Docker container with pre-installed dep…
google-labs-jules[bot] 3b5e579
Optimize CI by using a custom Docker container with pre-installed dep…
google-labs-jules[bot] a2efc91
Optimize CI by using a custom Docker container with pre-installed dep…
google-labs-jules[bot] 9189a20
Merge branch 'master' into feature/ci-container-optimization-15610411…
shai-almog 167f481
Optimize CI by using a custom Docker container with pre-installed dep…
google-labs-jules[bot] d9de952
Optimize CI by using a custom Docker container with pre-installed dep…
google-labs-jules[bot] 550d74c
Optimize CI workflows by utilizing a dedicated Docker container (`ghc…
google-labs-jules[bot] b6d4e2f
Fix CI build failures by using correct JDK 17 path for script executi…
google-labs-jules[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| FROM ubuntu:24.04 | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Install basics and tools | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl \ | ||
| wget \ | ||
| gnupg \ | ||
| ca-certificates \ | ||
| git \ | ||
| unzip \ | ||
| zip \ | ||
| python3 \ | ||
| python3-pip \ | ||
| xvfb \ | ||
| libgl1-mesa-dri \ | ||
| libxtst6 \ | ||
| libxxf86vm1 \ | ||
| ant \ | ||
| maven \ | ||
| libncurses6 \ | ||
| libstdc++6 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Setup Azul Repo | ||
| RUN curl -s https://repos.azul.com/azul-repo.key | gpg --dearmor -o /usr/share/keyrings/azul.gpg \ | ||
| && echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list | ||
|
|
||
| # Install JDKs 11, 17, 21, 25 | ||
| RUN apt-get update && apt-get install -y \ | ||
| zulu11-jdk \ | ||
| zulu17-jdk \ | ||
| zulu21-jdk \ | ||
| zulu25-jdk \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install ZuluFX 8 (Tarball) | ||
| # URL for Zulu 8 + FX (x64 Linux) | ||
| # Using a fixed version to ensure reproducibility. | ||
| RUN mkdir -p /usr/lib/jvm/zulu8-fx && \ | ||
| curl -L "https://cdn.azul.com/zulu/bin/zulu8.82.0.21-ca-fx-jdk8.0.432-linux_x64.tar.gz" -o /tmp/zulu8.tar.gz && \ | ||
| tar -xzf /tmp/zulu8.tar.gz -C /usr/lib/jvm/zulu8-fx --strip-components=1 && \ | ||
| rm /tmp/zulu8.tar.gz | ||
|
|
||
| # Clone cn1-binaries | ||
| RUN git clone --depth=1 https://github.com/codenameone/cn1-binaries /opt/cn1-binaries | ||
|
|
||
| # Set Environment Variables for JDKs (Paths for apt installed JDKs usually symlinked to /usr/lib/jvm/zulu-XX-amd64) | ||
| ENV JAVA8_HOME=/usr/lib/jvm/zulu8-fx | ||
| ENV JDK8_HOME=/usr/lib/jvm/zulu8-fx | ||
| ENV JAVA11_HOME=/usr/lib/jvm/zulu11-ca-amd64 | ||
| ENV JDK11_HOME=/usr/lib/jvm/zulu11-ca-amd64 | ||
| ENV JAVA17_HOME=/usr/lib/jvm/zulu17-ca-amd64 | ||
| ENV JDK17_HOME=/usr/lib/jvm/zulu17-ca-amd64 | ||
| ENV JAVA21_HOME=/usr/lib/jvm/zulu21-ca-amd64 | ||
| ENV JDK21_HOME=/usr/lib/jvm/zulu21-ca-amd64 | ||
| ENV JAVA25_HOME=/usr/lib/jvm/zulu25-ca-amd64 | ||
| ENV JDK25_HOME=/usr/lib/jvm/zulu25-ca-amd64 | ||
|
|
||
| # Install Android SDK | ||
| ENV ANDROID_HOME=/opt/android-sdk | ||
| ENV ANDROID_SDK_ROOT=/opt/android-sdk | ||
| ENV CMDLINE_TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" | ||
|
|
||
| RUN mkdir -p ${ANDROID_HOME}/cmdline-tools && \ | ||
| wget -q ${CMDLINE_TOOLS_URL} -O /tmp/cmdline-tools.zip && \ | ||
| unzip -q /tmp/cmdline-tools.zip -d ${ANDROID_HOME}/cmdline-tools && \ | ||
| mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest && \ | ||
| rm /tmp/cmdline-tools.zip | ||
|
|
||
| ENV PATH=${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator:${PATH} | ||
|
|
||
| # Accept licenses and install packages | ||
| # Note: sdkmanager requires Java 11+ to run. We use JAVA17_HOME for this step. | ||
| # We dynamically locate Zulu 17 to ensure the correct path is used. | ||
| RUN export JAVA17_REAL=$(find /usr/lib/jvm -maxdepth 1 -name "zulu*17*" -type d | head -n 1) && \ | ||
| echo "Using JDK 17 at: $JAVA17_REAL" && \ | ||
| yes | JAVA_HOME=$JAVA17_REAL sdkmanager --licenses && \ | ||
| JAVA_HOME=$JAVA17_REAL sdkmanager "platform-tools" "platforms;android-31" "build-tools;31.0.0" | ||
|
|
||
| # Set Default JAVA_HOME to Java 8 (as per user requirement for builds) | ||
| ENV JAVA_HOME=/usr/lib/jvm/zulu8-fx | ||
| ENV PATH=$JAVA_HOME/bin:$PATH | ||
|
|
||
| ENV CN1_BINARIES=/opt/cn1-binaries | ||
|
|
||
| # Verify installations | ||
| RUN java -version && \ | ||
| $JAVA11_HOME/bin/java -version && \ | ||
| $JAVA17_HOME/bin/java -version && \ | ||
| $JAVA21_HOME/bin/java -version && \ | ||
| $JAVA25_HOME/bin/java -version && \ | ||
| ant -version && \ | ||
| mvn -version && \ | ||
| python3 --version && \ | ||
| JAVA_HOME=${JAVA17_HOME} sdkmanager --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Build CI Container | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - '.ci/container/**' | ||
| - '.github/workflows/build-container.yml' | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Downcase Image Name | ||
| run: | | ||
| echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}/ci-container" >> ${GITHUB_ENV} | ||
|
|
||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: .ci/container | ||
| push: true | ||
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
javac.classpathnow references${file.reference.asm-9.8.jar},${file.reference.asm-commons-9.8.jar}, and${file.reference.asm-tree-9.8.jar}, but the only defined properties remainfile.reference.asm-5.0.3.jar,file.reference.asm-commons-5.0.3.jar, andfile.reference.asm-tree-5.0.3.jar. In Ant/NetBeans builds the undefined properties resolve to empty strings, so the ASM JARs drop out of the classpath and ByteCodeTranslator will fail to compile with missing ASM classes. Please align the property names with the new 9.8 JARs or update the classpath to use the existing definitions.Useful? React with 👍 / 👎.