Skip to content

Commit fcc0343

Browse files
Fix CI after GHA's drop of node16 actions (#2338)
Fix CI after GHA's drop of node16 actions
1 parent 89021d0 commit fcc0343

File tree

5 files changed

+40
-29
lines changed

5 files changed

+40
-29
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
distribution: "temurin"
2626

2727
- name: Set up Gradle
28-
uses: gradle/actions/setup-gradle@v3
28+
uses: gradle/actions/setup-gradle@v4
2929

3030
- name: Run unit tests
3131
env:
@@ -66,7 +66,7 @@ jobs:
6666
distribution: "temurin"
6767

6868
- name: Set up Gradle
69-
uses: gradle/actions/setup-gradle@v3
69+
uses: gradle/actions/setup-gradle@v4
7070

7171
- name: Start containerized server and dependencies
7272
run: |
@@ -113,7 +113,7 @@ jobs:
113113
distribution: "temurin"
114114

115115
- name: Set up Gradle
116-
uses: gradle/actions/setup-gradle@v3
116+
uses: gradle/actions/setup-gradle@v4
117117

118118
- name: Run cloud test
119119
# Only supported in non-fork runs, since secrets are not available in forks. We intentionally
@@ -152,7 +152,7 @@ jobs:
152152
distribution: "temurin"
153153

154154
- name: Set up Gradle
155-
uses: gradle/actions/setup-gradle@v3
155+
uses: gradle/actions/setup-gradle@v4
156156

157157
- name: Run copyright and code format checks
158158
run: ./gradlew --no-daemon checkLicenseMain checkLicenses spotlessCheck

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
distribution: 'temurin'
2121

2222
- name: Set up Gradle
23-
uses: gradle/actions/setup-gradle@v3
23+
uses: gradle/actions/setup-gradle@v4
2424

2525
- name: Run Tests
2626
run: ./gradlew test -x checkLicenseMain -x checkLicenses -x spotlessCheck -x spotlessApply -Pjacoco

.github/workflows/prepare-release.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
distribution: "temurin"
9393

9494
- name: Set up Gradle
95-
uses: gradle/actions/setup-gradle@v3
95+
uses: gradle/actions/setup-gradle@v4
9696

9797
- name: Set up signing key
9898
run: mkdir -p "$HOME/.gnupg" && echo -n "$KEY" | base64 -d > "$HOME/.gnupg/secring.gpg"
@@ -128,7 +128,7 @@ jobs:
128128
fail-fast: false
129129
matrix:
130130
include:
131-
- runner: buildjet-2vcpu-ubuntu-1804
131+
- runner: ubuntu-latest
132132
os_family: linux
133133
arch: amd64
134134
- runner: macos-13
@@ -138,43 +138,45 @@ jobs:
138138
os_family: windows
139139
arch: amd64
140140
runs-on: ${{ matrix.runner }}
141-
env:
142-
# This is required to allow continuing usage of Node 16 for actions,
143-
# as Node 20 won't run on the builder we use for linux builds
144-
# (Node 20 require glibc 2.28+, but ubuntu-1804 has glibc 2.27).
145-
# https://github.blog/changelog/2024-05-17-updated-dates-for-actions-runner-using-node20-instead-of-node16-by-default/
146-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
147141
steps:
148142
- name: Checkout repo
149-
# FIXME: v4+ requires Node 20
150-
uses: actions/checkout@v3
143+
uses: actions/checkout@v4
151144
with:
145+
submodules: recursive
152146
ref: ${{ env.INPUT_REF }}
153147

154148
# See comment on temporary tag above. tldr: this is a local tag; never
155149
# gets pushed
156150
- name: Temporary tag
157151
run: git tag "$INPUT_TAG"
158-
152+
159153
- name: Set up Java
160-
# FIXME: v4+ requires Node 20
161-
uses: actions/setup-java@v3
154+
if: matrix.os_family != 'Linux'
155+
uses: actions/setup-java@v4
162156
with:
163157
java-version: "11"
164158
distribution: "temurin"
165159

166160
- name: Set up Gradle
167-
# FIXME: v3+ requires Node 20
168-
uses: gradle/gradle-build-action@v2
169-
170-
- name: Build native test server
171-
run: ./gradlew :temporal-test-server:build
161+
if: matrix.os_family != 'Linux'
162+
uses: gradle/actions/setup-gradle@v4
172163

164+
- name: Build native test server (non-Docker)
165+
if: matrix.os_family != 'Linux'
166+
run: |
167+
./gradlew :temporal-test-server:build
168+
169+
- name: Build native test server (Docker)
170+
if: matrix.os_family == 'Linux'
171+
run: |
172+
docker run \
173+
--rm -w /github/workspace -v "$(pwd):/github/workspace" \
174+
$(docker build -q ./docker/native-image) \
175+
sh -c "./gradlew :temporal-test-server:build"
173176
# path ends in a wildcard because on windows the file ends in '.exe'
174177
# path excludes *.txt because native-image also writes a build manifest txt file
175178
- name: Upload executable to workflow
176-
# FIXME: v4+ requires Node 20
177-
uses: actions/upload-artifact@v3
179+
uses: actions/upload-artifact@v4
178180
with:
179181
name: ${{ matrix.os_family }}_${{ matrix.arch }}
180182
path: |
@@ -185,16 +187,15 @@ jobs:
185187

186188
attach_to_release:
187189
name: Attach native executables to release
188-
needs: build_native_images
190+
needs: [build_native_images, create_draft_release]
189191
runs-on: ubuntu-latest
190192
steps:
191193
- name: Audit gh version
192194
run: gh --version
193195

194196
# when no artifact is specified, all artifacts are downloaded and expanded into CWD
195197
- name: Fetch executables
196-
# Need v3 here to stay compatible with the build_native_images job.
197-
uses: actions/download-artifact@v3-node20
198+
uses: actions/download-artifact@v4
198199

199200
# example: linux_amd64/ -> temporal-test-server_1.2.3_linux_amd64
200201
# the name of the directory created becomes the basename of the archive (*.tar.gz or *.zip) and

.github/workflows/publish-snapshot.yml

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

4141
- name: Set up Gradle
42-
uses: gradle/actions/setup-gradle@v3
42+
uses: gradle/actions/setup-gradle@v4
4343

4444
# Prefer env variables here rather than inline ${{ secrets.FOO }} to
4545
# decrease the likelihood that secrets end up printed to stdout.

docker/native-image/dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Use an old version of Ubuntu to build the test server to maintain compatibility with
2+
# older versions of glibc, specifically glib 2.17.
3+
FROM ubuntu:18.04
4+
ENV JAVA_HOME=/opt/java/openjdk
5+
COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
6+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
7+
RUN apt-get update
8+
RUN apt-get install -y git build-essential zlib1g-dev
9+
# Avoid errors like: "fatal: detected dubious ownership in repository"
10+
RUN git config --global --add safe.directory '*'

0 commit comments

Comments
 (0)