forked from faiscadev/fakecloud
-
Notifications
You must be signed in to change notification settings - Fork 0
273 lines (260 loc) · 9.37 KB
/
Copy pathsdks.yml
File metadata and controls
273 lines (260 loc) · 9.37 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
263
264
265
266
267
268
269
270
271
272
273
name: SDKs
on:
push:
branches: [main]
paths:
- "sdks/**"
- "crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/sdks.yml"
pull_request:
branches: [main]
paths:
- "sdks/**"
- "crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/sdks.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Compile the fakecloud server once and share it with every language's e2e
# job as an artifact. The SDK e2e suites exec the prebuilt binary at
# `target/release/fakecloud` (they never `cargo run`), so a downloaded binary
# is all they need — no per-language Rust rebuild.
build:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/free-disk
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
# Dedicated key so this never collides with ci.yml's free-disk `test`
# job cache (which symlinks ./target onto /mnt). The job is not named
# `test`, so `github.job` won't clash either.
shared-key: sdk-build
- name: Build fakecloud
run: cargo build --release
- name: Upload fakecloud binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fakecloud-binary-sdk
path: target/release/fakecloud
if-no-files-found: error
retention-days: 1
# ---- Python ----------------------------------------------------------------
python-lint:
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/python
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- run: pip install '.[dev]'
- run: ruff check .
- run: ruff format --check .
python-typecheck:
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/python
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- run: pip install '.[dev]'
- run: mypy src
python-test:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/python
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Download fakecloud binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: fakecloud-binary-sdk
path: target/release
- name: Mark fakecloud binary executable
run: chmod +x target/release/fakecloud
working-directory: .
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- run: pip install '.[dev]'
- run: pytest -v
# ---- TypeScript ------------------------------------------------------------
typescript:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/typescript
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Download fakecloud binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: fakecloud-binary-sdk
path: target/release
- name: Mark fakecloud binary executable
run: chmod +x target/release/fakecloud
working-directory: .
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: npm
cache-dependency-path: sdks/typescript/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm test
# ---- Go --------------------------------------------------------------------
go-build:
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/go
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.24"
cache-dependency-path: sdks/go/go.sum
- run: go build ./...
- run: go test ./...
go-e2e:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Download fakecloud binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: fakecloud-binary-sdk
path: target/release
- name: Mark fakecloud binary executable
run: chmod +x target/release/fakecloud
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.24"
cache-dependency-path: sdks/go/e2e/go.sum
- name: Run e2e tests
run: go test -v -timeout 120s ./...
working-directory: sdks/go/e2e
go-lint:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.24"
cache-dependency-path: sdks/go/go.sum
- uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
working-directory: sdks/go
args: --timeout=5m
- uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
working-directory: sdks/go/e2e
args: --timeout=5m
# ---- Java ------------------------------------------------------------------
java:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/java
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Download fakecloud binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: fakecloud-binary-sdk
path: target/release
- name: Mark fakecloud binary executable
run: chmod +x target/release/fakecloud
working-directory: .
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: "17"
cache: gradle
- name: Build and test
run: ./gradlew build --no-daemon
# ---- PHP -------------------------------------------------------------------
php:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/php
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Download fakecloud binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: fakecloud-binary-sdk
path: target/release
- name: Mark fakecloud binary executable
run: chmod +x target/release/fakecloud
working-directory: .
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: "8.3"
extensions: curl, json
tools: composer
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run unit tests
run: vendor/bin/phpunit --testsuite unit
- name: Run E2E tests
# The harness self-spawns target/release/fakecloud on an ephemeral
# port and fails loud if it is missing/unhealthy (no manual boot).
run: vendor/bin/phpunit --testsuite e2e
# ---- .NET ------------------------------------------------------------------
dotnet:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: sdks/dotnet
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Download fakecloud binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: fakecloud-binary-sdk
path: target/release
- name: Mark fakecloud binary executable
run: chmod +x target/release/fakecloud
working-directory: .
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: |
8.0.x
10.0.x
- name: Run unit + E2E tests
# The E2E collection fixture spawns the downloaded binary itself from
# target/release (fail-loud if missing), so no manual boot is needed.
run: dotnet test --configuration Release