-
Notifications
You must be signed in to change notification settings - Fork 5
104 lines (96 loc) · 3.56 KB
/
integration.yaml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Integration
# Controls when the workflow will run
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 */6 * * *' # Every 6 hours
workflow_dispatch:
inputs:
restateCommit:
description: 'restate commit'
required: false
default: ''
type: string
restateImage:
description: 'restate image, superseded by restate commit'
required: false
default: 'ghcr.io/restatedev/restate:main'
type: string
workflow_call:
inputs:
restateCommit:
description: 'restate commit'
required: false
default: ''
type: string
restateImage:
description: 'restate image, superseded by restate commit'
required: false
default: 'ghcr.io/restatedev/restate:main'
type: string
envVars:
required: false
type: string
description: list of vars and values used when running the test tool
testArtifactOutput:
required: false
type: string
description: name of the test artifact output
jobs:
sdk-test-suite:
if: github.repository_owner == 'restatedev'
runs-on: ubuntu-latest
name: "Features integration test (sdk-test-suite version 2.2)"
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
steps:
- uses: actions/checkout@v4
with:
repository: restatedev/sdk-java
### Download the Restate container image, if needed
# Setup restate snapshot if necessary
# Due to https://github.com/actions/upload-artifact/issues/53
# We must use download-artifact to get artifacts created during *this* workflow run, ie by workflow call
- name: Download restate snapshot from in-progress workflow
if: ${{ inputs.restateCommit != '' && github.event_name != 'workflow_dispatch' }}
uses: actions/download-artifact@v4
with:
name: restate.tar
# In the workflow dispatch case where the artifact was created in a previous run, we can download as normal
- name: Download restate snapshot from completed workflow
if: ${{ inputs.restateCommit != '' && github.event_name == 'workflow_dispatch' }}
uses: dawidd6/action-download-artifact@v3
with:
repo: restatedev/restate
workflow: ci.yml
commit: ${{ inputs.restateCommit }}
name: restate.tar
- name: Install restate snapshot
if: ${{ inputs.restateCommit != '' }}
run: |
output=$(docker load --input restate.tar)
docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest"
docker image ls -a
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build restatedev/java-test-services image
run: ./gradlew -Djib.console=plain :test-services:jibDockerBuild
- name: Run test tool 2.2
uses: restatedev/sdk-test-suite@v2.2
with:
envVars: ${{ inputs.envVars }}
testArtifactOutput: ${{ inputs.testArtifactOutput != '' && inputs.testArtifactOutput || 'sdk-java-integration-test-report' }}
restateContainerImage: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }}
serviceContainerImage: 'restatedev/java-test-services'