-
Notifications
You must be signed in to change notification settings - Fork 25
144 lines (133 loc) · 5.23 KB
/
Copy pathintegration-fetch.yaml
File metadata and controls
144 lines (133 loc) · 5.23 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Integration Fetch
# Controls when the workflow will run
on:
pull_request:
push:
branches: [main, release-**]
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
serviceImage:
description: "service image, if provided it will skip building the image from sdk main branch"
required: false
default: ""
type: string
jobs:
sdk-test-suite:
if: github.repository_owner == 'restatedev'
runs-on: warp-ubuntu-latest-x64-4x
name: Fetch integration test
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
with:
repository: restatedev/sdk-typescript
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@v4
with:
version: 11.1.3
- run: pnpm install --frozen-lockfile
- run: pnpm build
# support importing oci-format restate.tar
- name: Set up Docker containerd snapshotter
uses: docker/setup-docker-action@v4
with:
version: "v28.5.2"
set-host: true
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}
### Download the Restate container image, if needed
# 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@v6
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 | head -n 1)
docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest"
docker image ls -a
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
network=host
# Pre-emptively pull the test-services image, to avoid affecting execution time
- name: Pull test services image
if: ${{ inputs.serviceImage != '' }}
shell: bash
run: docker pull ${{ inputs.serviceImage }}
- name: Build Typescript test-services image
if: ${{ inputs.serviceImage == '' }}
id: build
uses: docker/build-push-action@v6
with:
context: .
file: "packages/tests/restate-e2e-services/Dockerfile"
push: false
load: true
tags: restatedev/typescript-test-services
cache-from: type=gha,url=http://127.0.0.1:49160/,version=1,scope=${{ github.workflow }}
cache-to: type=gha,url=http://127.0.0.1:49160/,mode=max,version=1,scope=${{ github.workflow }}
- name: Prepare fetch service container environment
id: service-env
shell: bash
run: |
env_file=".service-container-fetch.env"
cp packages/tests/restate-e2e-services/.env "$env_file"
printf "\n" >> "$env_file"
printf "RESTATE_E2E_ENDPOINT_ADAPTER=fetch\n" >> "$env_file"
printf "SERVICES=MemoryLeakProbe\n" >> "$env_file"
echo "path=$env_file" >> "$GITHUB_OUTPUT"
- name: Run test tool
uses: restatedev/e2e/sdk-tests@v2.2
with:
restateContainerImage: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }}
serviceContainerImage: ${{ inputs.serviceImage != '' && inputs.serviceImage || 'restatedev/typescript-test-services' }}
exclusionsFile: "packages/tests/restate-e2e-services/exclusions.yaml"
customTestsFile: "packages/tests/restate-e2e-services/custom_tests_fetch.yaml"
serviceContainerEnvFile: ${{ steps.service-env.outputs.path }}
testSuite: default
testName: Custom
testArtifactOutput: sdk-typescript-fetch-integration-test-report