-
Notifications
You must be signed in to change notification settings - Fork 919
76 lines (63 loc) · 2.5 KB
/
reusable-pr-smoke-test-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Every workflow that includes this must also include the following to make sure that it
# is triggered when a new JDK is added to the matrix:
#on:
# push:
# paths:
# - ".github/workflows/reusable-pr-smoke-test-images.yml"
name: PR build fake backend images for smoke tests
on:
workflow_call:
inputs:
project:
type: string
required: true
cache-read-only:
type: boolean
required: false
skip-java-8:
type: boolean
required: false
skip-java-11:
type: boolean
required: false
skip-java-17:
type: boolean
required: false
skip-java-21:
type: boolean
required: false
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Free disk space
run: .github/scripts/gha-free-disk-space.sh
- name: Set up JDK for running Gradle
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
distribution: temurin
java-version-file: .java-version
- name: Set tag
run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set up Gradle cache
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0
with:
cache-read-only: ${{ inputs.cache-read-only }}
- name: Build Java 8 Docker image
if: "!inputs.skip-java-8"
run: ./gradlew ${{ inputs.project }}:jibDockerBuild -Ptag=${{ env.TAG }} -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain
- name: Build Java 11 Docker image
if: "!inputs.skip-java-11"
run: ./gradlew ${{ inputs.project }}:jibDockerBuild -Ptag=${{ env.TAG }} -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain
- name: Build Java 17 Docker image
if: "!inputs.skip-java-17"
run: ./gradlew ${{ inputs.project }}:jibDockerBuild -Ptag=${{ env.TAG }} -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain
- name: Build Java 21 Docker image
if: "!inputs.skip-java-21"
run: ./gradlew ${{ inputs.project }}:jibDockerBuild -Ptag=${{ env.TAG }} -PtargetJDK=21 -Djib.httpTimeout=120000 -Djib.console=plain
- name: Build Java 23 Docker image
if: "!inputs.skip-java-23"
run: ./gradlew ${{ inputs.project }}:jibDockerBuild -Ptag=${{ env.TAG }} -PtargetJDK=23 -Djib.httpTimeout=120000 -Djib.console=plain