Reusable smoke test image workflow
MODIFY
.github/workflows/pr-smoke-test-grpc-images.yml
.github/workflows/pr-smoke-test-grpc-images.yml
@@ -8,33 +8,7 @@ on:
jobs:
build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: temurin
- java-version: 11
-
- - name: Set up gradle cache
- uses: gradle/gradle-build-action@v2
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
with:
+ build-root-directory: smoke-tests/images/grpc
cache-read-only: true
-
- - name: Build Java 8 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/grpc
-
- - name: Build Java 11 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/grpc
-
- - name: Build Java 17 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/grpc
-
- - name: Build Java 18 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/grpc

MODIFY
.github/workflows/pr-smoke-test-play-images.yml
.github/workflows/pr-smoke-test-play-images.yml
@@ -8,6 +8,16 @@ on:
jobs:
build:
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
+ with:
+ build-root-directory: smoke-tests/images/play
+ cache-read-only: true
+ # Play doesn't support Java 16+ yet
+ # https://github.com/playframework/playframework/pull/10819
+ skip-java-17: true
+ skip-java-18: true
+
+ build-java-15:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -23,14 +33,6 @@ jobs:
with:
cache-read-only: true
- - name: Build Java 8 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/play
-
- - name: Build Java 11 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/play
-
# Play doesn't support Java 16 (or 17) yet
# https://github.com/playframework/playframework/pull/10819
- name: Build Java 15 Docker Image

MODIFY
.github/workflows/pr-smoke-test-quarkus-images.yml
.github/workflows/pr-smoke-test-quarkus-images.yml
@@ -8,30 +8,9 @@ on:
jobs:
build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: temurin
- java-version: 11
-
- - name: Set up gradle cache
- uses: gradle/gradle-build-action@v2
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
with:
+ build-root-directory: smoke-tests/images/quarkus
cache-read-only: true
-
# Quarkus 2.0+ does not support Java 8
- - name: Build Java 11 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/quarkus
-
- - name: Build Java 17 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/quarkus
-
- - name: Build Java 18 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/quarkus
+ skip-java-8: true

MODIFY
.github/workflows/pr-smoke-test-spring-boot-images.yml
.github/workflows/pr-smoke-test-spring-boot-images.yml
@@ -8,33 +8,7 @@ on:
jobs:
build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: temurin
- java-version: 11
-
- - name: Set up gradle cache
- uses: gradle/gradle-build-action@v2
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
with:
+ build-root-directory: smoke-tests/images/spring-boot
cache-read-only: true
-
- - name: Build Java 8 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/spring-boot
-
- - name: Build Java 11 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/spring-boot
-
- - name: Build Java 17 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/spring-boot
-
- - name: Build Java 18 Docker Image
- run: ./gradlew jibDockerBuild -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain
- working-directory: smoke-tests/images/spring-boot

MODIFY
.github/workflows/publish-smoke-test-grpc-images.yml
.github/workflows/publish-smoke-test-grpc-images.yml
@@ -11,44 +11,10 @@ on:
jobs:
publish:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: temurin
- java-version: 11
-
- - name: Login to GitHub Package Registry
- uses: docker/login-action@v1.10.0
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Set Tag
- run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV
-
- - name: Set up gradle cache
- uses: gradle/gradle-build-action@v2
-
- - name: Build Java 8 Docker Image
- run: ./gradlew jib -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/grpc
-
- - name: Build Java 11 Docker Image
- run: ./gradlew jib -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/grpc
-
- - name: Build Java 17 Docker Image
- run: ./gradlew jib -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/grpc
-
- - name: Build Java 18 Docker Image
- run: ./gradlew jib -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/grpc
+ build-root-directory: smoke-tests/images/grpc
+ publish: true
issue:
name: Open issue on failure

MODIFY
.github/workflows/publish-smoke-test-play-images.yml
.github/workflows/publish-smoke-test-play-images.yml
@@ -11,6 +11,16 @@ on:
jobs:
publish:
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
+ with:
+ build-root-directory: smoke-tests/images/play
+ publish: true
+ # Play doesn't support Java 16+ yet
+ # https://github.com/playframework/playframework/pull/10819
+ skip-java-17: true
+ skip-java-18: true
+
+ publish-java-15:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -34,14 +44,6 @@ jobs:
- name: Set up gradle cache
uses: gradle/gradle-build-action@v2
- - name: Build Java 8 Docker Image
- run: ./gradlew jib -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/play
-
- - name: Build Java 11 Docker Image
- run: ./gradlew jib -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/play
-
# Play doesn't support Java 16 (or 17) yet
# https://github.com/playframework/playframework/pull/10819
- name: Build Java 15 Docker Image

MODIFY
.github/workflows/publish-smoke-test-quarkus-images.yml
.github/workflows/publish-smoke-test-quarkus-images.yml
@@ -10,42 +10,13 @@ on:
workflow_dispatch:
jobs:
- publish:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: temurin
- java-version: 11
-
- - name: Login to GitHub Package Registry
- uses: docker/login-action@v1.10.0
+ build:
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Set Tag
- run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV
-
- - name: Set up gradle cache
- uses: gradle/gradle-build-action@v2
-
+ build-root-directory: smoke-tests/images/quarkus
+ publish: true
# Quarkus 2.0+ does not support Java 8
- - name: Build Java 11 Docker Image
- run: ./gradlew jib -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/quarkus
-
- - name: Build Java 17 Docker Image
- run: ./gradlew jib -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/quarkus
-
- - name: Build Java 18 Docker Image
- run: ./gradlew jib -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/quarkus
+ skip-java-8: true
issue:
name: Open issue on failure

MODIFY
.github/workflows/publish-smoke-test-spring-boot-images.yml
.github/workflows/publish-smoke-test-spring-boot-images.yml
@@ -11,44 +11,10 @@ on:
jobs:
publish:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: temurin
- java-version: 11
-
- - name: Login to GitHub Package Registry
- uses: docker/login-action@v1.10.0
+ uses: ./.github/workflows/reusable-smoke-test-images.yml
with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Set Tag
- run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV
-
- - name: Set up gradle cache
- uses: gradle/gradle-build-action@v2
-
- - name: Build Java 8 Docker Image
- run: ./gradlew jib -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/spring-boot
-
- - name: Build Java 11 Docker Image
- run: ./gradlew jib -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/spring-boot
-
- - name: Build Java 17 Docker Image
- run: ./gradlew jib -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/spring-boot
-
- - name: Build Java 18 Docker Image
- run: ./gradlew jib -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=${{ env.TAG }}
- working-directory: smoke-tests/images/spring-boot
+ build-root-directory: smoke-tests/images/spring-boot
+ publish: true
issue:
name: Open issue on failure

ADD
.github/workflows/reusable-smoke-test-images.yml
+name: PR build fake backend images for smoke tests
+
+on:
+ workflow_call:
+ inputs:
+ build-root-directory:
+ type: string
+ required: true
+ publish:
+ type: boolean
+ required: false
+ cache-read-only:
+ type: boolean
+ required: false
+ skip-java-8:
+ type: boolean
+ required: false
+ skip-java-17:
+ type: boolean
+ required: false
+ skip-java-18:
+ type: boolean
+ required: false
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set up JDK 11 for running Gradle
+ uses: actions/setup-java@v2
+ with:
+ distribution: temurin
+ java-version: 11
+
+ - name: Login to GitHub Package Registry
+ if: ${{ inputs.publish }}
+ uses: docker/login-action@v1.10.0
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Set Tag
+ run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV
+
+ - name: Set up gradle cache
+ uses: gradle/gradle-build-action@v2
+ with:
+ cache-read-only: ${{ inputs.cache-read-only }}
+
+ - name: Build Java 8 Docker Image
+ if: ${{ !inputs.skip-java-8 }}
+ run: ./gradlew ${{ inputs.publish && 'jib' || 'jibDockerBuild' }} -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain
+ working-directory: ${{ inputs.build-root-directory }}
+
+ - name: Build Java 11 Docker Image
+ run: ./gradlew ${{ inputs.publish && 'jib' || 'jibDockerBuild' }} -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain
+ working-directory: ${{ inputs.build-root-directory }}
+
+ - name: Build Java 17 Docker Image
+ if: ${{ !inputs.skip-java-17 }}
+ run: ./gradlew ${{ inputs.publish && 'jib' || 'jibDockerBuild' }} -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain
+ working-directory: ${{ inputs.build-root-directory }}
+
+ - name: Build Java 18 Docker Image
+ if: ${{ !inputs.skip-java-18 }}
+ run: ./gradlew ${{ inputs.publish && 'jib' || 'jibDockerBuild' }} -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain
+ working-directory: ${{ inputs.build-root-directory }}

Reusable smoke test image workflow (#5609)