Skip to content

Commit d4c506c

Browse files
Optimize PR CI with custom Docker image and pre-installed dependencies
- Added `.ci/container/Dockerfile` to pre-install JDKs (8, 17, 21) and cache `cn1-binaries`. - Added `.github/workflows/build-container.yml` to build and push the image to GHCR, ensuring the repository name is lowercased for valid Docker tags. - Updated `.github/workflows/pr.yml` to run inside the new container, replacing `setup-java` with fast environment switching and linking pre-downloaded binaries. - Fixed an issue where mixed-case repository names caused Docker build failures by enforcing lowercase tags in `build-container.yml` and using the canonical image name in `pr.yml`.
1 parent 6a721aa commit d4c506c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/build-container.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@ jobs:
2424
username: ${{ github.actor }}
2525
password: ${{ secrets.GITHUB_TOKEN }}
2626

27+
- name: Lowercase Repository Name
28+
id: string
29+
uses: ASzc/change-string-case-action@v5
30+
with:
31+
string: ${{ github.repository }}
32+
2733
- name: Build and push Docker image
2834
uses: docker/build-push-action@v4
2935
with:
3036
context: .ci/container
3137
push: true
32-
tags: ghcr.io/${{ github.repository }}/pr-ci-container:latest
38+
tags: ghcr.io/${{ steps.string.outputs.lowercase }}/pr-ci-container:latest

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
runs-on: ubuntu-latest
4141
container:
42-
image: ghcr.io/${{ github.repository }}/pr-ci-container:latest
42+
image: ghcr.io/codenameone/codenameone/pr-ci-container:latest
4343
options: --privileged
4444
strategy:
4545
fail-fast: false

0 commit comments

Comments
 (0)