@@ -13,150 +13,42 @@ permissions:
1313 contents : read
1414
1515jobs :
16- # ======== ut ========
1716 ut :
18- runs-on : ${{ matrix.os }}
1917 strategy :
2018 matrix :
21- os : [ubuntu-latest]
22- node-version : [18, 20, 22]
19+ runner : [ubuntu-latest, windows-latest]
20+ node-version : [22]
21+ uses : ./.github/workflows/reusable-test.yml
22+ with :
23+ runner : ${{ matrix.runner }}
24+ node-version : ${{ matrix.node-version }}
25+ task : ut
26+
27+ integration :
28+ strategy :
29+ matrix :
30+ runner : [ubuntu-latest]
31+ node-version : [18, 22]
2332 include :
24- - node-version : 18
25- os : windows-latest
26-
27- steps :
28- - name : Checkout
29- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
30- with :
31- fetch-depth : 1
32-
33- - name : Git config
34- if : ${{ matrix.os == 'windows-latest' }}
35- shell : bash
36- run : |
37- git config --system core.longpaths true
38-
39- - name : Install pnpm
40- run : |
41- npm install -g corepack@latest --force
42- corepack enable
43-
44- - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
45- id : changes
46- with :
47- predicate-quantifier : ' every'
48- filters : |
49- changed:
50- - "!**/*.md"
51- - "!**/*.mdx"
52- - "!**/_meta.json"
53- - "!**/dictionary.txt"
54-
55- - name : Setup Node.js ${{ matrix.node-version }}
56- if : steps.changes.outputs.changed == 'true'
57- uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
58- with :
59- node-version : ${{ matrix.node-version }}
60- cache : ' pnpm'
61-
62- # Special handling for Node.js 18: use Node.js 20 for tsgo dependency installation
63- - name : Setup Node.js 20 for dependency installation (Node 18 only)
64- if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
65- uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
66- with :
67- node-version : 20
68- cache : ' pnpm'
69-
70- - name : Install Dependencies
71- if : steps.changes.outputs.changed == 'true'
72- run : pnpm install
73-
74- # Switch back to Node.js 18 after dependency installation
75- - name : Switch back to Node.js ${{ matrix.node-version }} (Node 18 only)
76- if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
77- uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
78- with :
79- node-version : ${{ matrix.node-version }}
80- cache : ' pnpm'
81-
82- - name : Type Check
83- if : steps.changes.outputs.changed == 'true'
84- run : pnpm run type-check
33+ - runner : windows-latest
34+ node-version : 22
8535
86- - name : Unit Test
87- if : steps.changes.outputs.changed == 'true'
88- run : pnpm run test:unit
36+ uses : ./.github/workflows/reusable-test.yml
37+ with :
38+ runner : ${{ matrix.runner }}
39+ node-version : ${{ matrix.node-version }}
40+ task : integration
8941
90- # ======== integration && e2e ========
91- integration-e2e :
92- runs-on : ${{ matrix.os }}
42+ e2e :
9343 strategy :
9444 matrix :
95- os : [ubuntu-latest]
96- node-version : [18, 20, 22]
45+ runner : [ubuntu-latest]
46+ node-version : [18, 22]
9747 include :
98- - node-version : 18
99- os : windows-latest
100-
101- steps :
102- - name : Checkout
103- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
104- with :
105- fetch-depth : 1
106-
107- - name : Git config
108- if : ${{ matrix.os == 'windows-latest' }}
109- shell : bash
110- run : |
111- git config --system core.longpaths true
112-
113- - name : Install pnpm
114- run : |
115- npm install -g corepack@latest --force
116- corepack enable
117-
118- - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
119- id : changes
120- with :
121- predicate-quantifier : ' every'
122- filters : |
123- changed:
124- - "!**/*.md"
125- - "!**/*.mdx"
126- - "!**/_meta.json"
127- - "!**/dictionary.txt"
128-
129- - name : Setup Node.js ${{ matrix.node-version }}
130- if : steps.changes.outputs.changed == 'true'
131- uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
132- with :
133- node-version : ${{ matrix.node-version }}
134- cache : ' pnpm'
135-
136- # Special handling for Node.js 18: use Node.js 20 for tsgo dependency installation
137- - name : Setup Node.js 20 for dependency installation (Node 18 only)
138- if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
139- uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
140- with :
141- node-version : 20
142- cache : ' pnpm'
143-
144- - name : Install Dependencies
145- if : steps.changes.outputs.changed == 'true'
146- run : pnpm install && cd ./tests && pnpm playwright install chromium
147-
148- # Switch back to Node.js 18 after dependency installation
149- - name : Switch back to Node.js ${{ matrix.node-version }} (Node 18 only)
150- if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
151- uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
152- with :
153- node-version : ${{ matrix.node-version }}
154- cache : ' pnpm'
155-
156- - name : Integration Test (Rstest)
157- if : steps.changes.outputs.changed == 'true'
158- run : pnpm run test:integration
159-
160- - name : E2E Test (Playwright)
161- if : steps.changes.outputs.changed == 'true'
162- run : pnpm run test:e2e
48+ - runner : windows-latest
49+ node-version : 22
50+ uses : ./.github/workflows/reusable-test.yml
51+ with :
52+ runner : ${{ matrix.runner }}
53+ node-version : ${{ matrix.node-version }}
54+ task : e2e
0 commit comments