Skip to content

Commit f4a26e0

Browse files
authored
Fix native-image CI docker build flake (#2832)
1 parent f8ddd7e commit f4a26e0

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/build-native-image.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,36 +69,39 @@ jobs:
6969
ref: ${{ env.INPUT_REF }}
7070

7171
- name: Set up Java
72-
if: matrix.os_family != 'Linux'
72+
if: matrix.os_family != 'linux'
7373
uses: actions/setup-java@v5
7474
with:
7575
java-version: 23
7676
distribution: "graalvm"
7777

7878
- name: Set up Gradle
79-
if: matrix.os_family != 'Linux'
79+
if: matrix.os_family != 'linux'
8080
uses: gradle/actions/setup-gradle@v5
8181

8282
- name: Build native test server (non-Docker)
83-
if: matrix.os_family != 'Linux'
83+
if: matrix.os_family != 'linux'
8484
run: |
8585
./gradlew -PnativeBuild :temporal-test-server:nativeCompile
8686
8787
- name: Build native test server (Docker non-musl)
88-
if: matrix.os_family == 'Linux' && matrix.musl == false
88+
if: matrix.os_family == 'linux' && matrix.musl == false
8989
run: |
90+
IMAGE_ID=$(docker build -q ./docker/native-image)
9091
docker run \
9192
--rm -w /github/workspace -v "$(pwd):/github/workspace" \
92-
$(docker build -q ./docker/native-image) \
93+
"$IMAGE_ID" \
9394
sh -c "./gradlew -PnativeBuild :temporal-test-server:nativeCompile"
9495
9596
- name: Build native test server (Docker musl)
96-
if: matrix.os_family == 'Linux' && matrix.musl == true
97+
if: matrix.os_family == 'linux' && matrix.musl == true
9798
run: |
99+
IMAGE_ID=$(docker build -q ./docker/native-image-musl)
98100
docker run \
99101
--rm -w /github/workspace -v "$(pwd):/github/workspace" \
100-
$(docker build -q ./docker/native-image-musl) \
102+
"$IMAGE_ID" \
101103
sh -c "./gradlew -PnativeBuild -PnativeBuildMusl :temporal-test-server:nativeCompile"
104+
102105
# path ends in a wildcard because on windows the file ends in '.exe'
103106
- name: Upload executable to workflow
104107
if: ${{ inputs.upload_artifact }}

docker/native-image/dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV JAVA_HOME=/usr/lib64/graalvm/graalvm-community-java23
66
COPY --from=ghcr.io/graalvm/native-image-community:23 $JAVA_HOME $JAVA_HOME
77
ENV PATH="${JAVA_HOME}/bin:${PATH}"
88
RUN apt-get -y update --allow-releaseinfo-change && apt-get install -V -y software-properties-common
9-
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
9+
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
1010
RUN apt-get update
1111
# We need to update gcc and g++ to 10 for Graal to work on ARM64
1212
RUN apt-get install -y git build-essential zlib1g-dev gcc-10 g++-10

0 commit comments

Comments
 (0)