Repository navigation
79 lines (76 loc) · 2.46 KB
/
Copy pathtest-packages.yml
File metadata and controls
79 lines (76 loc) · 2.46 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
name: Test Packages
on:
workflow_call:
inputs:
packages:
description: 'JSON array of package names to test'
type: string
required: true
jobs:
test:
runs-on: ubuntu-26.04
permissions:
contents: read
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(inputs.packages) }}
name: Test ${{ matrix.package }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
cache: 'npm'
node-version-file: '.nvmrc'
- uses: ./.github/actions/install-dependencies
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: build
path: packages
- uses: ./.github/actions/test-package
with:
package_name: ${{ matrix.package }}
results:
name: Test Results
runs-on: ubuntu-26.04
needs: test
if: ${{ !cancelled() }}
permissions:
checks: write
pull-requests: write
contents: read
issues: read
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
# Download every per-package test-output artifact. Each lands
# in its own subdirectory (e.g. scratch-gui-test-output/),
# which avoids filename collisions between packages that both
# produce junit.xml.
pattern: '*-test-output'
path: test-results
- name: Publish test reports
uses: EnricoMi/publish-unit-test-result-action@7622c5bf3d112a72ab4fa3951c2aa5723d8ab92d # v2.25.0
with:
# Every test reporter in this repo produces JUnit XML.
# Restricting to *.xml avoids the action trying to parse
# directories and non-test artifacts (Playwright HTML
# reports, traces, screenshots, etc.) as test result files.
files: test-results/**/*.xml
check_name: "Test Results"
- name: Check test outcome
run: |
case "${{ needs.test.result }}" in
success)
echo "Tests passed successfully."
exit 0
;;
cancelled)
echo "Tests were cancelled."
exit 1
;;
*)
echo "Tests failed. Result: ${{ needs.test.result }}"
exit 1
;;
esac