Skip to content

Commit e4998c1

Browse files
authored
Merge pull request #143 from wiremock/claude/upgrade-java-17-container-test-2J8PL
Upgrade Java runtime to 17 for both 3.x and 4.x builds
2 parents bc6be8d + b4ed1a2 commit e4998c1

12 files changed

Lines changed: 132 additions & 14 deletions

File tree

.github/workflows/ci-4.x-beta.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI - 4.x-beta
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
docker-build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
versions:
16+
- CONTEXT: .
17+
TAGS:
18+
- wiremock/wiremock:test
19+
PLATFORMS:
20+
- linux/amd64
21+
- linux/arm64
22+
- linux/arm/v7
23+
- CONTEXT: alpine
24+
TAGS:
25+
- wiremock/wiremock:test-alpine
26+
PLATFORMS:
27+
- linux/amd64
28+
29+
steps:
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v2
33+
with:
34+
image: tonistiigi/binfmt:latest
35+
platforms: all
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v2
39+
40+
- name: Checkout sources
41+
uses: actions/checkout@main
42+
43+
# TODO: Re-enable if rate limit becomes an issues
44+
# - name: Login to Docker Hub
45+
# uses: docker/login-action@v2
46+
# with:
47+
# username: wiremock
48+
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
49+
50+
- name: Build WireMock Docker image
51+
uses: docker/build-push-action@v4
52+
with:
53+
context: ${{ matrix.versions.CONTEXT }}
54+
platforms: ${{ join(matrix.versions.PLATFORMS, ',') }}
55+
push: false
56+
file: ${{ matrix.versions.CONTEXT }}/Dockerfile
57+
tags: ${{ matrix.versions.TAGS[0] }}
58+
build-args: |
59+
WIREMOCK_VERSION=4.0.0-beta.29
60+
61+
- name: Build Wiremock Docker image
62+
run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile --build-arg JAVA_VERSION=17 --build-arg WIREMOCK_VERSION=4.0.0-beta.29
63+
64+
- name: Set up JDK
65+
uses: actions/setup-java@v3
66+
with:
67+
java-version: 17
68+
distribution: 'temurin'
69+
cache: maven
70+
71+
- name: Run integration test
72+
working-directory: test/integration-tests
73+
run: mvn -B -ntp package verify --file pom.xml -DargLine="-Dit.wiremock-image=${{ matrix.versions.TAGS[0] }}"
74+
75+
container-image-scan:
76+
uses: ./.github/workflows/container-image-scan.yml
77+
needs: docker-build
78+
with:
79+
image_version: latest
80+
secrets: inherit

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ jobs:
5555
push: false
5656
file: ${{ matrix.versions.CONTEXT }}/Dockerfile
5757
tags: ${{ matrix.versions.TAGS[0] }}
58+
build-args: |
59+
WIREMOCK_VERSION=3.13.2
5860
5961
- name: Build Wiremock Docker image
60-
run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile
62+
run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile --build-arg JAVA_VERSION=17 --build-arg WIREMOCK_VERSION=3.13.2
6163

6264
- name: Set up JDK
6365
uses: actions/setup-java@v3
6466
with:
65-
java-version: 11
67+
java-version: 17
6668
distribution: 'temurin'
6769
cache: maven
6870

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Set up JDK
6666
uses: actions/setup-java@v3
6767
with:
68-
java-version: 11
68+
java-version: 17
6969
distribution: 'temurin'
7070
cache: maven
7171

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Set up JDK
6767
uses: actions/setup-java@v3
6868
with:
69-
java-version: 11
69+
java-version: 17
7070
distribution: 'temurin'
7171
cache: maven
7272

.github/workflows/release-4.x-beta.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,40 @@ jobs:
2828
LATEST_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/wiremock/wiremock.git '4.*.*' | tail -1 | cut -d '/' -f3)
2929
echo "NEW_VERSION=${{ github.event.inputs.bundled-version }}-${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
3030
31-
docker-build-push:
31+
verify-container-startup:
3232
runs-on: ubuntu-latest
3333
needs: [check-new-version]
3434
if: needs.check-new-version.outputs.new_version
35+
steps:
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v2
39+
40+
- name: Checkout sources
41+
uses: actions/checkout@main
42+
43+
- name: Build WireMock Docker image (local)
44+
run: |
45+
docker buildx build \
46+
--tag wiremock/wiremock:verify \
47+
--load \
48+
--build-arg "WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}" \
49+
--build-arg "JAVA_VERSION=17" \
50+
--file Dockerfile \
51+
.
52+
53+
- name: Verify container startup
54+
run: |
55+
docker run -d --name wiremock-test -p 8080:8080 wiremock/wiremock:verify
56+
timeout 30 bash -c 'until curl -sf http://localhost:8080/__admin/health; do sleep 1; done'
57+
echo "WireMock container started and health check passed"
58+
docker stop wiremock-test
59+
docker rm wiremock-test
60+
61+
docker-build-push:
62+
runs-on: ubuntu-latest
63+
needs: [check-new-version, verify-container-startup]
64+
if: needs.check-new-version.outputs.new_version
3565
strategy:
3666
matrix:
3767
versions:
@@ -96,7 +126,8 @@ jobs:
96126
push: true
97127
tags: ${{ join(matrix.versions.IMAGES, ',') }}
98128
build-args: |
99-
"WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}"
129+
WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}
130+
JAVA_VERSION=17
100131
101132
container-image-scan:
102133
uses: ./.github/workflows/container-image-scan.yml

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ jobs:
9595
push: true
9696
tags: ${{ join(matrix.versions.IMAGES, ',') }}
9797
build-args: |
98-
"WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}"
98+
WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}
99+
JAVA_VERSION=17
99100
100101
container-image-scan:
101102
uses: ./.github/workflows/container-image-scan.yml

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55

66
test/integration-tests/target
77
test/integration-tests/integration-tests.iml
8+
9+
.claude

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM eclipse-temurin:11.0.24_8-jre
1+
ARG JAVA_VERSION=17
2+
FROM eclipse-temurin:${JAVA_VERSION}-jre
23

34
LABEL maintainer="Rodolphe CHAIGNEAU <rodolphe.chaigneau@gmail.com>"
45

Dockerfile-nightly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD
22

3-
FROM gradle:7-jdk11 AS builder
3+
FROM gradle:8-jdk17 AS builder
44

55
WORKDIR /workdir
66

@@ -12,7 +12,7 @@ RUN ./gradlew shadowJar
1212

1313
# RUN
1414

15-
FROM eclipse-temurin:11.0.24_8-jre
15+
FROM eclipse-temurin:17-jre
1616

1717
LABEL maintainer="Rodolphe CHAIGNEAU <rodolphe.chaigneau@gmail.com>"
1818

alpine/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM eclipse-temurin:11-jre-alpine
1+
ARG JAVA_VERSION=17
2+
FROM eclipse-temurin:${JAVA_VERSION}-jre-alpine
23

34
LABEL maintainer="Rodolphe CHAIGNEAU <rodolphe.chaigneau@gmail.com>"
45

0 commit comments

Comments
 (0)