-
Notifications
You must be signed in to change notification settings - Fork 23
262 lines (251 loc) · 8.66 KB
/
ci.yml
File metadata and controls
262 lines (251 loc) · 8.66 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
name: Continuous Integration
permissions:
contents: read
actions: write
checks: write
env:
MISE_VERSION: v2025.8.1
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
jobs:
test-omes:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Run tests
run: |
go test -v -race ./... 2>&1 | \
go run github.com/jstemmer/go-junit-report/v2@latest \
-set-exit-code -iocopy -out junit-omes.xml
- name: Publish Test Results
uses: mikepenz/action-junit-report@v5.6.2
if: failure()
with:
report_paths: "junit-omes.xml"
check_name: "Omes Test Failures"
detailed_summary: true
check_annotations: false
annotate_only: true
skip_annotations: true
check-worker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [go, java, python, typescript, dotnet]
include:
- sdk: go
tools: go
- sdk: java
tools: java go
- sdk: python
tools: python go
- sdk: typescript
tools: rust go node protoc
- sdk: dotnet
tools: dotnet go
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install mise
uses: jdx/mise-action@v2.4.4
with:
version: ${{ env.MISE_VERSION }}
- name: Install Tools
run: |
go run ./cmd/dev install ${{ matrix.tools }}
- name: Add Go bin to PATH
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Lint and format ${{ matrix.sdk }} worker
run: |
go run ./cmd/dev lint-and-format ${{ matrix.sdk }}
- name: Check formatting
run: |
git diff --exit-code || (echo "${{ matrix.sdk }} worker has uncommitted formatting changes" && exit 1)
- name: Test ${{ matrix.sdk }} worker
run: |
go run ./cmd/dev test ${{ matrix.sdk }}
build-worker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [go, java, python, typescript, dotnet]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Build ${{ matrix.sdk }} worker image
run: |
go run ./cmd/dev build-worker-image \
--language ${{ matrix.sdk }} \
--tag-as-latest
- name: Start ${{ matrix.sdk }} worker image
run: |
docker run \
--rm \
-i -p 10233:10233 omes:${{ matrix.sdk }}-latest \
--scenario workflow_with_single_noop_activity \
--log-level debug \
--language ${{ matrix.sdk }} \
--run-id ${{ github.run_id }} \
--embedded-server-address 0.0.0.0:10233 &
- name: Wait for ${{ matrix.sdk }} worker image to start
run: |
timeout 30 bash -c 'until nc -z 127.0.0.1 10233; do sleep 1; done' || (echo "Server failed to start" && exit 1)
- name: Start ${{ matrix.sdk }} worker image
run: |
go run ./cmd run-scenario \
--scenario workflow_with_single_noop_activity \
--log-level debug \
--server-address 127.0.0.1:10233 \
--run-id ${{ github.run_id }} \
--connect-timeout 1m \
--iterations 5
test-kitchensink:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [go, java, python, typescript, dotnet]
include:
- sdk: go
tools: go
- sdk: java
tools: java go
- sdk: python
tools: python go
- sdk: typescript
tools: node go
- sdk: dotnet
tools: dotnet go
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install mise
uses: jdx/mise-action@v2.4.4
with:
version: ${{ env.MISE_VERSION }}
- name: Install Tools
run: |
go run ./cmd/dev install ${{ matrix.tools }}
- name: Test Kitchensink ${{ matrix.sdk }}
run: |
SDK=${{ matrix.sdk }} go test -v -race ./loadgen -run TestKitchenSink 2>&1 | \
go run github.com/jstemmer/go-junit-report/v2@latest \
-set-exit-code -iocopy -out junit-kitchensink-${{ matrix.sdk }}.xml
- name: Publish Kitchensink Test Results
uses: mikepenz/action-junit-report@v5.6.2
if: failure()
with:
report_paths: "junit-kitchensink-${{ matrix.sdk }}.xml"
check_name: "Kitchensink Test Failures (${{ matrix.sdk }})"
detailed_summary: true
check_annotations: false
annotate_only: true
skip_annotations: true
build-ks-gen-and-ensure-protos-up-to-date:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: "true"
- name: Install mise
uses: jdx/mise-action@v2.4.4
with:
version: ${{ env.MISE_VERSION }}
- name: Install Tools
run: |
go run ./cmd/dev install rust go protoc node
- name: Add Go bin to PATH
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Build proto
run: |
go run ./cmd/dev build-proto
- name: Check diff
run: |
git config --global core.safecrlf false
git diff > generator.diff
git diff --exit-code
- name: Upload generator diff
uses: actions/upload-artifact@v4
if: always()
with:
name: generator-diff
path: generator.diff
if-no-files-found: ignore
build-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build CLI image
run: |
go run ./cmd/dev build-cli-image
- name: Test CLI image
run: |
IMAGE_TAG=$(echo "$BUILT_IMAGE_TAGS" | cut -d';' -f1)
docker run --rm --pull never $IMAGE_TAG --help
docker run --rm --pull never $IMAGE_TAG list-scenarios
docker run --rm --pull never --entrypoint /app/kitchen-sink-gen $IMAGE_TAG --help
# env cannot be referenced in jobs.<job_id>.with.<with_id>, so we need a job to run before
# to append a "v" to the version string
prepare-for-docker-push:
runs-on: ubuntu-latest
outputs:
go-sdk-version: ${{ steps.set-output.outputs.go-sdk-version }}
ts-sdk-version: ${{ steps.set-output.outputs.ts-sdk-version }}
java-sdk-version: ${{ steps.set-output.outputs.java-sdk-version }}
python-sdk-version: ${{ steps.set-output.outputs.python-sdk-version }}
dotnet-sdk-version: ${{ steps.set-output.outputs.dotnet-sdk-version }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Load versions
run: |
set -a && source versions.env && set +a
printenv >> $GITHUB_ENV
- name: Set output variables to pass to docker YML
id: set-output
run: |
echo "go-sdk-version=v${{ env.GO_SDK_VERSION }}" >> "$GITHUB_OUTPUT"
echo "ts-sdk-version=v${{ env.TYPESCRIPT_SDK_VERSION }}" >> "$GITHUB_OUTPUT"
echo "java-sdk-version=v${{ env.JAVA_SDK_VERSION }}" >> "$GITHUB_OUTPUT"
echo "python-sdk-version=v${{ env.PYTHON_SDK_VERSION }}" >> "$GITHUB_OUTPUT"
echo "dotnet-sdk-version=v${{ env.DOTNET_SDK_VERSION }}" >> "$GITHUB_OUTPUT"
push-docker-images:
needs: prepare-for-docker-push
uses: ./.github/workflows/all-docker-images.yml
secrets: inherit
with:
# Only images that are built from `main` are tagged as `latest`.
# This ensures that internal systems can rely on the latest tag to be stable.
as-latest: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
do-push: true
go-version: ${{ needs.prepare-for-docker-push.outputs.go-sdk-version }}
ts-version: ${{ needs.prepare-for-docker-push.outputs.ts-sdk-version }}
java-version: ${{ needs.prepare-for-docker-push.outputs.java-sdk-version }}
py-version: ${{ needs.prepare-for-docker-push.outputs.python-sdk-version }}
dotnet-version: ${{ needs.prepare-for-docker-push.outputs.dotnet-sdk-version }}