-
Notifications
You must be signed in to change notification settings - Fork 10
208 lines (199 loc) · 9.14 KB
/
ci.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
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
name: Continuous Integration
## !!NOTE!! Make sure you keep the sdk versions used in the build/test steps consistent with
## the versions used when building & pushing the docker images.
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
jobs:
build-lint-test-go:
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "^1.21"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Test
run: go test ./...
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language go --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language go --version v1.29.0 --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:go-1.29.0 --scenario workflow_with_single_noop_activity --log-level debug --language go --run-id {{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes 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
build-lint-test-java:
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Lint Java worker
run: cd workers/java && ./gradlew --no-daemon spotlessCheck
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "^1.21"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language java --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language java --version 1.26.1 --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:java-1.26.1 --scenario workflow_with_single_noop_activity --log-level debug --language java --run-id {{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes 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
build-lint-test-python:
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install Python prequisites
run: python -m pip install --upgrade wheel poetry poethepoet
- name: Initialize Python worker
run: cd workers/python && poetry install --no-root
- name: Lint Python worker
run: cd workers/python && poe lint
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "^1.20"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language python --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language python --version 1.7.0 --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:python-1.7.0 --scenario workflow_with_single_noop_activity --log-level debug --language python --run-id {{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes 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
build-lint-test-typescript:
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup TypeScript
uses: actions/setup-node@v4
- name: Initialize TypeScript worker
run: cd workers/typescript && npm ci && npm run build
- name: Lint TypeScript worker
run: cd workers/typescript && npm run lint-ci
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "^1.21"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language ts --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language ts --version 1.10.2 --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:typescript-1.10.2 --scenario workflow_with_single_noop_activity --log-level debug --language ts --run-id {{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes 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
build-lint-test-dotnet:
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
- name: Check formatting
run: cd workers/dotnet && dotnet format --verify-no-changes
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "^1.21"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language cs --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language cs --version 1.3.1 --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:dotnet-1.3.1 --scenario workflow_with_single_noop_activity --log-level debug --language cs --run-id {{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes 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
build-ks-gen-and-ensure-protos-up-to-date:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'true'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.74.0
override: true
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
version: '25.1'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "^1.21"
- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/[email protected]
- name: Build kitchen-sink-gen
working-directory: ./loadgen/kitchen-sink-gen
run: cargo build
- 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
push-latest-docker-images:
uses: ./.github/workflows/all-docker-images.yml
secrets: inherit
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
do-push: true
as-latest: true
go-version: 'v1.29.0'
ts-version: 'v1.10.2'
java-version: 'v1.26.0'
py-version: 'v1.7.0'
dotnet-version: 'v1.3.1'