Repository navigation
432 lines (366 loc) · 13.7 KB
/
Copy pathbuild-test-package.yml
File metadata and controls
432 lines (366 loc) · 13.7 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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
name: build test and package
on:
push:
branches:
- main
tags:
- "v*"
paths-ignore:
- ".devcontainer/**"
- ".github/**"
- "!.github/workflows/**"
- "docs/**"
pull_request:
branches:
- main
workflow_dispatch:
env:
PYTHONUNBUFFERED: "1"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
robot-version:
["rf50", "rf60", "rf61", "rf70", "rf71", "rf72", "rf73", "rf74", "rf75"]
# each Robot Framework version only with the Python versions it officially supports, see CONTRIBUTING.md
exclude:
- { python-version: "3.11", robot-version: "rf50" }
- { python-version: "3.12", robot-version: "rf50" }
- { python-version: "3.12", robot-version: "rf60" }
- { python-version: "3.13", robot-version: "rf50" }
- { python-version: "3.13", robot-version: "rf60" }
- { python-version: "3.13", robot-version: "rf61" }
- { python-version: "3.13", robot-version: "rf70" }
- { python-version: "3.14", robot-version: "rf50" }
- { python-version: "3.14", robot-version: "rf60" }
- { python-version: "3.14", robot-version: "rf61" }
- { python-version: "3.14", robot-version: "rf70" }
- { python-version: "3.14", robot-version: "rf71" }
- { python-version: "3.14", robot-version: "rf72" }
- { python-version: "3.15", robot-version: "rf50" }
- { python-version: "3.15", robot-version: "rf60" }
- { python-version: "3.15", robot-version: "rf61" }
- { python-version: "3.15", robot-version: "rf70" }
- { python-version: "3.15", robot-version: "rf71" }
- { python-version: "3.15", robot-version: "rf72" }
- { python-version: "3.15", robot-version: "rf73" }
- { python-version: "3.15", robot-version: "rf74" }
steps:
- uses: actions/checkout@v6
- name: Setup python ${{ matrix.python-version }} environment
id: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
uses: pypa/hatch@install
- name: Check Python of the test environment
env:
# without it, Hatch creates the environment with the Python it runs on itself
HATCH_PYTHON: ${{ steps.setup-python.outputs.python-path }}
run: hatch run test.${{ matrix.robot-version }}:python -c "import sys; print(sys.version); sys.exit(sys.version_info[:2] != tuple(map(int, '${{ matrix.python-version }}'.split('.'))))"
- name: Test Python Packages
env:
HATCH_PYTHON: ${{ steps.setup-python.outputs.python-path }}
run: hatch run test.${{ matrix.robot-version }}:test "--junitxml=test-results/os-${{ matrix.os }}-py-${{ matrix.python-version }}-${{ matrix.robot-version }}/test-results.xml"
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-os-${{ matrix.os }}-py-${{ matrix.python-version }}-${{ matrix.robot-version }}
path: test-results
test-jetbrains:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: jetbrains
java-version: 21
env:
# the JetBrains distribution reads the token for its GitHub API requests only from here
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-cleanup: always
- name: Test JetBrains Plugin
working-directory: intellij-client
run: ./gradlew --console=plain test
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-jetbrains-${{ matrix.os }}
path: intellij-client/build/test-results/test
test-vscode:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
# the minimum version that engines.vscode in package.json declares, and the newest stable release
vscode: [minimum, stable]
steps:
- uses: actions/checkout@v6
- name: Setup Node.js environment
uses: actions/setup-node@v6
with:
node-version: "26"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Update npm
# Node.js bundles an older npm; use the current one, as in local development.
run: npm install -g npm@latest
- name: install node modules
run: npm install --include=dev
- name: Resolve the VS Code version
id: vscode
# minimum as .vscode-test.mjs reads it; stable from the API that @vscode/test-electron asks
env:
VSCODE_LEG: ${{ matrix.vscode }}
run: |
if [ "$VSCODE_LEG" = "minimum" ]; then
version=$(node -p "require('./package.json').engines.vscode.replace(/^[^0-9]*/, '')")
else
version=$(curl -fsSL https://update.code.visualstudio.com/api/releases/stable | node -p "JSON.parse(require('fs').readFileSync(0, 'utf8'))[0]")
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Cache VS Code and its extensions for the tests
# per resolved version; the extensions stay at the versions installed first for it
uses: actions/cache@v6
with:
path: |
.vscode-test/vscode-*
.vscode-test/extensions
key: vscode-test-${{ runner.os }}-${{ steps.vscode.outputs.version }}
- name: Test VS Code Extension
# VS Code needs a display on Linux; the reporters of .vscode-test.mjs list the tests in the log and write
# test-results/vscode/test-results.xml
env:
VSCODE_VERSION: ${{ steps.vscode.outputs.version }}
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
xvfb-run -a npm test -- --reporter mocha-multi-reporters --code-version "$VSCODE_VERSION"
else
npm test -- --reporter mocha-multi-reporters --code-version "$VSCODE_VERSION"
fi
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-vscode-${{ matrix.os }}-${{ matrix.vscode }}
path: test-results/vscode
publish-test-results:
needs: [test, test-jetbrains, test-vscode]
runs-on: ubuntu-latest
permissions:
checks: write
# only needed unless run with comment_mode: off
pull-requests: write
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: (!cancelled())
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: |
./**/test-results.xml
./**/TEST-*.xml
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js environment
uses: actions/setup-node@v6
with:
node-version: "26"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Update npm
# Node.js bundles an older npm; use the current one, as in local development.
run: npm install -g npm@latest
- name: install node modules
run: npm install --include=dev
- name: setup python environment
id: setup-python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install Hatch
uses: pypa/hatch@install
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: jetbrains
java-version: 21
env:
# the JetBrains distribution reads the token for its GitHub API requests only from here
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-cleanup: always
- run: hatch run lint:style
if: always()
- run: hatch run lint:typing
if: always()
- name: Verify JetBrains Plugin (released IDE versions)
if: always()
working-directory: intellij-client
run: |
finish() {
shopt -s nullglob
reports=(build/reports/pluginVerifier/*/report.md)
{
echo "# Plugin Verifier: Released IDE Versions"
echo
[ ${#reports[@]} -gt 0 ] || echo "No report was written, see the log of this step."
for report in "${reports[@]}"; do
echo "- $(basename "$(dirname "$report")"): $(awk 'NR > 1 && NF { print; exit }' "$report")"
done
for report in "${reports[@]}"; do
echo
sed 's/^#/##/' "$report"
done
} >> "$GITHUB_STEP_SUMMARY"
}
trap finish EXIT
./gradlew --console=plain verifyPlugin
- name: Verify JetBrains Plugin (EAP builds)
if: always()
# EAP builds only warn; the released versions above are the gate
continue-on-error: true
working-directory: intellij-client
run: |
finish() {
status=$?
shopt -s nullglob
reports=(build/reports/pluginVerifier-eap/*/report.md)
problems=""
{
echo "# Plugin Verifier: EAP Builds"
echo
[ ${#reports[@]} -gt 0 ] || echo "No report was written, see the log of this step."
for report in "${reports[@]}"; do
ide=$(basename "$(dirname "$report")")
verdict=$(awk 'NR > 1 && NF { print; exit }' "$report")
echo "- $ide: $verdict"
[[ $verdict == Compatible* ]] || problems+="${problems:+; }$ide: $verdict"
done
for report in "${reports[@]}"; do
echo
sed 's/^#/##/' "$report"
done
} >> "$GITHUB_STEP_SUMMARY"
if [ "$status" -ne 0 ]; then
echo "::warning title=Plugin verifier (EAP builds)::${problems:-verifyPlugin failed, see the log of this step}"
fi
}
trap finish EXIT
./gradlew --console=plain verifyPlugin -PverifyEap
- name: Upload Plugin Verifier Reports
if: always()
uses: actions/upload-artifact@v7
with:
name: pluginVerifier-result
path: |
intellij-client/build/reports/pluginVerifier
intellij-client/build/reports/pluginVerifier-eap
package:
needs: [test, test-jetbrains, test-vscode]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- run: git describe --tag
- run: git describe --tag --long --first-parent --match "v[0-9]*"
- name: setup python environment
id: setup-python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install Hatch
uses: pypa/hatch@install
- name: Setup Node.js environment
uses: actions/setup-node@v6
with:
node-version: "26"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Update npm
# Node.js bundles an older npm; use the current one, as in local development.
run: npm install -g npm@latest
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: jetbrains
java-version: 21
env:
# the JetBrains distribution reads the token for its GitHub API requests only from here
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-cleanup: always
- name: install node modules
run: npm install --include=dev
- name: update versions from git
if: ${{ !startsWith( github.ref, 'refs/tags/v') }}
run: hatch run build:update-git-versions
- name: update doc links
if: ${{ startsWith( github.ref, 'refs/tags/v') }}
run: hatch run build:update-doc-links
- name: Update Changelog
run: hatch run build:git-cliff -o CHANGELOG.md
- name: package
run: hatch run build:package
- name: Upload VSCode package
id: upload-vscode-package
uses: actions/upload-artifact@v7
with:
name: vscode-package
path: dist/robotcode*.vsix
- name: Upload python package
id: upload-python-packages
uses: actions/upload-artifact@v7
with:
name: python-packages
path: dist/*.tar.gz
- name: Upload python wheel package
id: upload-wheel-packages
uses: actions/upload-artifact@v7
with:
name: wheel-packages
path: dist/*.whl
- name: Upload intellij plugin
id: upload-intellij-package
uses: actions/upload-artifact@v7
with:
name: intellij-package
path: intellij-client/build/distributions/*.zip