Skip to content

Commit facaa51

Browse files
Skip building test image when not needed (#553)
1 parent 8861070 commit facaa51

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/integration.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ on:
2020
required: false
2121
default: 'ghcr.io/restatedev/restate:main'
2222
type: string
23+
serviceImage:
24+
description: "service image, if provided it will skip building the image from sdk main branch"
25+
required: false
26+
default: ""
27+
type: string
2328
workflow_call:
2429
inputs:
2530
restateCommit:
@@ -40,6 +45,11 @@ on:
4045
required: false
4146
type: string
4247
description: name of the test artifact output
48+
serviceImage:
49+
description: "service image, if provided it will skip building the image from sdk main branch"
50+
required: false
51+
default: ""
52+
type: string
4353

4454
jobs:
4555
sdk-test-suite:
@@ -95,21 +105,30 @@ jobs:
95105
docker image ls -a
96106
97107
- name: Setup Java
108+
if: ${{ inputs.serviceImage == '' }}
98109
uses: actions/setup-java@v4
99110
with:
100111
distribution: 'temurin'
101112
java-version: '21'
102113

103114
- name: Setup Gradle
115+
if: ${{ inputs.serviceImage == '' }}
104116
uses: gradle/actions/setup-gradle@v4
105117

106118
- name: Build restatedev/test-services-java image
119+
if: ${{ inputs.serviceImage == '' }}
107120
run: ./gradlew -Djib.console=plain :test-services:jibDockerBuild
108121

122+
# Pre-emptively pull the test-services image to avoid affecting execution time
123+
- name: Pull test services image
124+
if: ${{ inputs.serviceImage != '' }}
125+
shell: bash
126+
run: docker pull ${{ inputs.serviceImage }}
127+
109128
- name: Run test tool
110129
uses: restatedev/[email protected]
111130
with:
112131
envVars: ${{ inputs.envVars }}
113132
testArtifactOutput: ${{ inputs.testArtifactOutput != '' && inputs.testArtifactOutput || 'sdk-java-integration-test-report' }}
114133
restateContainerImage: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }}
115-
serviceContainerImage: 'restatedev/test-services-java'
134+
serviceContainerImage: ${{ inputs.serviceImage != '' && inputs.serviceImage || 'restatedev/test-services-java' }}

0 commit comments

Comments
 (0)