21
21
PRETTIER_LEGACY_CLI : " 1" # https://github.com/prettier/prettier/issues/15832
22
22
# https://docs.github.com/en/actions/learn-github-actions/environment-variables
23
23
# https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/
24
- WSLENV : HOSTNAME:CI:FORCE_COLOR:GITHUB_ACTION:GITHUB_ACTION_PATH/p:GITHUB_ACTION_REPOSITORY:GITHUB_WORKFLOW:GITHUB_WORKSPACE/p:GITHUB_PATH/p:GITHUB_ENV/p:VIRTUAL_ENV/p
24
+ WSLENV : HOSTNAME:CI:FORCE_COLOR:GITHUB_ACTION:GITHUB_ACTION_PATH/p:GITHUB_ACTION_REPOSITORY:GITHUB_WORKFLOW:GITHUB_WORKSPACE/p:GITHUB_PATH/p:GITHUB_ENV/p:VIRTUAL_ENV/p:SKIP_PODMAN:SKIP_DOCKER
25
25
# We define a hostname because otherwise the variable might not always be accessible on runners.
26
26
HOSTNAME : gha
27
27
28
28
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
29
29
jobs :
30
30
build :
31
31
name : ${{ matrix.name }}
32
- environment : ci # codecov needed
32
+ environment : ci
33
33
env :
34
- SKIP_PODMAN : ${{ matrix.env.SKIP_PODMAN || 0 }}
35
34
SKIP_DOCKER : ${{ matrix.env.SKIP_DOCKER || 0 }}
35
+ SKIP_PODMAN : ${{ matrix.env.SKIP_PODMAN || 0 }}
36
+ TASKFILE_ARGS : --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
37
+ # For using the mock Lightspeed server.
38
+ TEST_LIGHTSPEED_ACCESS_TOKEN : " dummy"
39
+ # The mock server runs on localhost. However, just using "localhost" as the hostname causes a few issues in
40
+ # GitHub Actions environment:
41
+ #
42
+ # On Linux: When "localhost" is used as the hostname, the mock server uses the ipv6 loopback address [::1] . However,
43
+ # the axios library, which is used in the extension tries to access to the ipv4 loopback 127.0.0.1 when "localhost"
44
+ # is specified and the axios library does not support URLs that contains ipv6 addresses, e.g. http://[::1]:3000.
45
+ # Also, If 127.0.0.1 is specified for the mock server, the server fails to start. Those issues are resolved by
46
+ # using the special ipv6-only hostname "ip6-localhost", which is available in GitHub Actions Linux environment.
47
+ #
48
+ # On MacOS: The hostname "ip6-localhost" is not available. However, 127.0.0.1 can be used for starting the mock
49
+ # server on MacOS and the axios library can connect to that address. So we can use 127.0.0.1 for MacOS.
50
+ #
51
+ # Once the axios library starts supporting URLs that contain ipv6 addresses, we will be able to use
52
+ # http://[::1]:3000 both on Linux and MacOS to get rid of the following conditional statement.
53
+ TEST_LIGHTSPEED_URL : " ${{ contains(matrix.name, 'macos') && 'http://127.0.0.1:3000' || 'http://ip6-localhost:3000' }}"
54
+
55
+ # Set environment variables using matrix properties.
56
+ # For using an actual Lightspeed server instance, uncomment following two lines.
57
+ # TEST_LIGHTSPEED_ACCESS_TOKEN: ${{ secrets.TEST_LIGHTSPEED_ACCESS_TOKEN }}
58
+ # TEST_LIGHTSPEED_URL: ${{ secrets.TEST_LIGHTSPEED_URL }}
59
+
36
60
defaults :
37
61
run :
38
62
shell : ${{ matrix.shell || 'bash'}}
39
- permissions :
40
- id-token : write
41
- checks : read
42
63
# The type of runner that the job will run on
43
64
runs-on : ${{ matrix.os || 'ubuntu-22.04' }}
44
65
# see https://github.com/containers/podman/issues/13609
@@ -50,32 +71,30 @@ jobs:
50
71
matrix :
51
72
# Avoid letting github do the matrix multiplication and use manual
52
73
# includes for each job, this gives us fine control over job name.
74
+ # Order is important, keep it alphabetical: docs, lint, test*
53
75
continue-on-error :
54
76
- false
55
77
os :
56
78
- ubuntu-22.04
57
79
task-name :
58
- - test
80
+ - docs
59
81
name :
60
- - test
82
+ - docs
61
83
include :
62
- # - name: test-node-lts
63
- # task-name: test
64
- # task-name-als: als:test-node-lts
65
- - name : docs
66
- task-name : docs
67
- task-name-als : " "
68
84
- name : lint
69
85
task-name : lint
70
- task-name-als : " "
71
86
os : ubuntu-22.04
72
87
env :
73
88
SKIP_PODMAN : 1
74
89
SKIP_DOCKER : 1
75
90
91
+ - name : test (linux)
92
+ task-name : test
93
+ # https://github.com/ansible/vscode-ansible/issues/1473
94
+ ignore-als-test-failure : true
95
+
76
96
- name : test (macos)
77
97
task-name : test
78
- task-name-als : als:test-without-ee
79
98
os : macos-13-large
80
99
env :
81
100
SKIP_PODMAN : 1
@@ -84,12 +103,12 @@ jobs:
84
103
# in order to enable the caching
85
104
continue-on-error : true
86
105
87
- - name : als: test-without-ee (wsl)
88
- # runner does not support running container
106
+ - name : test (wsl)
107
+ # runner does not support running containers
89
108
task-name : als:test-without-ee
90
109
log-name : als-test-without-ee
91
110
# https://github.com/actions/virtual-environments/issues/5151
92
- os : windows-2022
111
+ os : devtools-win-x64
93
112
shell : " wsl-bash {0}"
94
113
env :
95
114
SKIP_PODMAN : 1
@@ -223,87 +242,31 @@ jobs:
223
242
# uses: mxschmitt/action-tmate@v3
224
243
- name : task package
225
244
id : package
226
- run : task package --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
245
+ run : task package ${{ matrix.env.TASKFILE_ARGS }}
227
246
228
247
- name : task ${{ matrix.task-name }}
229
- env :
230
- # For using the mock Lightspeed server.
231
- TEST_LIGHTSPEED_ACCESS_TOKEN : " dummy"
232
- # The mock server runs on localhost. However, just using "localhost" as the hostname causes a few issues in
233
- # GitHub Actions environment:
234
- #
235
- # On Linux: When "localhost" is used as the hostname, the mock server uses the ipv6 loopback address [::1] . However,
236
- # the axios library, which is used in the extension tries to access to the ipv4 loopback 127.0.0.1 when "localhost"
237
- # is specified and the axios library does not support URLs that contains ipv6 addresses, e.g. http://[::1]:3000.
238
- # Also, If 127.0.0.1 is specified for the mock server, the server fails to start. Those issues are resolved by
239
- # using the special ipv6-only hostname "ip6-localhost", which is available in GitHub Actions Linux environment.
240
- #
241
- # On MacOS: The hostname "ip6-localhost" is not available. However, 127.0.0.1 can be used for starting the mock
242
- # server on MacOS and the axios library can connect to that address. So we can use 127.0.0.1 for MacOS.
243
- #
244
- # Once the axios library starts supporting URLs that contain ipv6 addresses, we will be able to use
245
- # http://[::1]:3000 both on Linux and MacOS to get rid of the following conditional statement.
246
- TEST_LIGHTSPEED_URL : " ${{ contains(matrix.name, 'macos') && 'http://127.0.0.1:3000' || 'http://ip6-localhost:3000' }}"
247
-
248
- # Set environment variables using matrix properties.
249
- SKIP_PODMAN : " ${{ matrix.env.SKIP_PODMAN || '0' }}"
250
- SKIP_DOCKER : " ${{ matrix.env.SKIP_DOCKER || '0' }}"
251
-
252
- # For using an actual Lightspeed server instance, uncomment following two lines.
253
- # TEST_LIGHTSPEED_ACCESS_TOKEN: ${{ secrets.TEST_LIGHTSPEED_ACCESS_TOKEN }}
254
- # TEST_LIGHTSPEED_URL: ${{ secrets.TEST_LIGHTSPEED_URL }}
255
- run : task ${{ matrix.task-name }} --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
256
-
257
- - name : task ${{ matrix.task-name-als }}
258
- if : ${{ (matrix.task-name-als || '') != '' }}
259
- env :
260
- SKIP_PODMAN : " ${{ matrix.env.SKIP_PODMAN || '0' }}"
261
- SKIP_DOCKER : " ${{ matrix.env.SKIP_DOCKER || '0' }}"
262
- run : task ${{ matrix.task-name-als }} --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
248
+ if : " ${{ !contains(matrix.name, 'test') }}"
249
+ run : task ${{ matrix.task-name }} ${{ matrix.env.TASKFILE_ARGS }}
263
250
264
- - name : Upload coverage data (unit test)
265
- if : ${{ startsWith(matrix.name, 'test') }}
266
- uses : codecov/codecov-action@v4
267
- with :
268
- name : ${{ matrix.name }}
269
- files : out/coverage/unit/lcov.info
270
- disable_search : true
271
- flags : unit
272
- fail_ci_if_error : true
273
- use_oidc : true # cspell:ignore oidc
251
+ - name : task unit
252
+ if : contains(matrix.name, 'test')
253
+ run : task unit ${{ matrix.env.TASKFILE_ARGS }}
274
254
275
- - name : Upload coverage data (ui test)
276
- if : ${{ startsWith(matrix.name, 'test') }}
277
- uses : codecov/codecov-action@v4
278
- with :
279
- name : ${{ matrix.name }}
280
- files : out/coverage/ui-test/lcov.info
281
- disable_search : true
282
- flags : ui
283
- fail_ci_if_error : true
284
- use_oidc : true # cspell:ignore oidc
255
+ - name : task ui
256
+ # https://github.com/ansible/vscode-ansible/issues/1451
257
+ if : " ${{ contains(matrix.name, 'test') && !contains(matrix.name, 'wsl') }}"
258
+ run : task ui ${{ matrix.env.TASKFILE_ARGS }}
285
259
286
- - name : Upload coverage data (e2e test)
287
- if : ${{ startsWith(matrix.name, 'test') }}
288
- uses : codecov/codecov-action@v4
289
- with :
290
- name : ${{ matrix.name }}
291
- files : out/coverage/e2e/lcov.info
292
- disable_search : true
293
- flags : e2e
294
- fail_ci_if_error : true
295
- use_oidc : true # cspell:ignore oidc
260
+ - name : task e2e
261
+ # https://github.com/ansible/vscode-ansible/issues/1451
262
+ if : " ${{ contains(matrix.name, 'test') && !contains(matrix.name, 'wsl') }}"
263
+ run : task e2e ${{ matrix.env.TASKFILE_ARGS }}
296
264
297
- - name : Upload coverage data (als)
298
- if : contains(matrix.task-name-als, 'test') || contains(matrix.task-name, 'als:test')
299
- uses : codecov/codecov-action@v4
300
- with :
301
- name : ${{ matrix.name }}
302
- files : out/coverage/als/lcov.info
303
- disable_search : true
304
- flags : als
305
- fail_ci_if_error : true
306
- use_oidc : true # cspell:ignore oidc
265
+ - name : task als
266
+ # https://github.com/ansible/vscode-ansible/issues/1451
267
+ if : contains(matrix.name, 'test')
268
+ continue-on-error : ${{ matrix.ignore-als-test-failure || false }}
269
+ run : task als ${{ matrix.env.TASKFILE_ARGS }}
307
270
308
271
- name : Upload vsix artifact
309
272
if : ${{ matrix.name == 'test' }}
@@ -323,12 +286,13 @@ jobs:
323
286
if-no-files-found : error
324
287
retention-days : 90
325
288
326
- - name : Upload test logs
289
+ - name : Upload test logs and reports
327
290
if : ${{ always() }}
328
291
uses : actions/upload-artifact@v4
329
292
with :
330
293
name : logs-${{ matrix.os }}-${{ matrix.log-name || matrix.task-name }}.zip
331
294
path : |
295
+ out/coverage
332
296
out/e2eTestReport
333
297
out/log
334
298
out/test-resources/settings/logs
@@ -367,6 +331,10 @@ jobs:
367
331
needs :
368
332
- build
369
333
334
+ permissions : # codecov
335
+ id-token : write
336
+ checks : read
337
+
370
338
runs-on : ubuntu-22.04
371
339
372
340
steps :
@@ -375,8 +343,55 @@ jobs:
375
343
with :
376
344
name : logs.zip
377
345
pattern : logs*.zip
346
+ separate-directories : true
378
347
delete-merged : true
379
348
349
+ - name : Download artifacts
350
+ uses : actions/download-artifact@v4
351
+ with :
352
+ name : logs.zip
353
+ path : .
354
+
355
+ - name : Upload als test coverage data [1/4]
356
+ uses : codecov/codecov-action@v4
357
+ with :
358
+ name : als
359
+ files : ./*/coverage/als/lcov.info
360
+ flags : als
361
+ disable_search : true
362
+ fail_ci_if_error : true
363
+ use_oidc : true # cspell:ignore oidc
364
+
365
+ - name : Upload unit test coverage data [2/4]
366
+ uses : codecov/codecov-action@v4
367
+ with :
368
+ name : unit
369
+ files : ./*/coverage/unit/lcov.info
370
+ flags : unit
371
+ disable_search : true
372
+ fail_ci_if_error : true
373
+ use_oidc : true # cspell:ignore oidc
374
+
375
+ - name : Upload ui test coverage data [3/4]
376
+ uses : codecov/codecov-action@v4
377
+ with :
378
+ name : unit
379
+ files : ./*/coverage/ui/lcov.info
380
+ flags : ui
381
+ disable_search : true
382
+ fail_ci_if_error : true
383
+ use_oidc : true # cspell:ignore oidc
384
+
385
+ - name : Upload e2e test coverage data [4/4]
386
+ uses : codecov/codecov-action@v4
387
+ with :
388
+ name : e2e
389
+ files : ./*/coverage/e2e/lcov.info
390
+ flags : e2e
391
+ disable_search : true
392
+ fail_ci_if_error : true
393
+ use_oidc : true # cspell:ignore oidc
394
+
380
395
- name : Decide whether the needed jobs succeeded or failed
381
396
uses : re-actors/alls-green@release/v1
382
397
with :
0 commit comments