Skip to content

Commit 4e63c4a

Browse files
committed
ci: add windows test
1 parent c4fe06d commit 4e63c4a

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

.github/workflows/test-ubuntu.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
changed:
4343
- "!**/*.md"
4444
- "!**/*.mdx"
45+
- "!**/_meta.json"
46+
- "!**/dictionary.txt"
4547
4648
- name: Setup Node.js ${{ matrix.node-version }}
4749
if: steps.changes.outputs.changed == 'true'
@@ -83,6 +85,8 @@ jobs:
8385
changed:
8486
- "!**/*.md"
8587
- "!**/*.mdx"
88+
- "!**/_meta.json"
89+
- "!**/dictionary.txt"
8690
8791
- name: Setup Node.js ${{ matrix.node-version }}
8892
if: steps.changes.outputs.changed == 'true'

.github/workflows/test-windows.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Test (Windows)
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on pull request events but only for the main branch
6+
pull_request:
7+
branches: [main]
8+
9+
push:
10+
branches: [main]
11+
12+
merge_group:
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
# ======== ut ========
20+
ut-windows:
21+
runs-on: windows-latest
22+
strategy:
23+
matrix:
24+
node-version: [18.x]
25+
26+
# Steps represent a sequence of tasks that will be executed as part of the job
27+
steps:
28+
- name: Git config
29+
shell: bash
30+
run: |
31+
git config --system core.longpaths true
32+
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 10
37+
38+
- name: Install Pnpm
39+
run: corepack enable
40+
41+
- uses: dorny/paths-filter@v3
42+
id: changes
43+
with:
44+
predicate-quantifier: 'every'
45+
filters: |
46+
changed:
47+
- "!**/*.md"
48+
- "!**/*.mdx"
49+
- "!**/_meta.json"
50+
- "!**/dictionary.txt"
51+
52+
- name: Setup Node.js ${{ matrix.node-version }}
53+
if: steps.changes.outputs.changed == 'true'
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: ${{ matrix.node-version }}
57+
cache: 'pnpm'
58+
59+
- name: Install Dependencies
60+
if: steps.changes.outputs.changed == 'true'
61+
run: pnpm install
62+
63+
- name: Unit Test
64+
if: steps.changes.outputs.changed == 'true'
65+
run: pnpm run test:unit
66+
67+
# # ======== e2e ========
68+
e2e-windows:
69+
runs-on: windows-latest
70+
strategy:
71+
matrix:
72+
node-version: [18.x]
73+
74+
# Steps represent a sequence of tasks that will be executed as part of the job
75+
steps:
76+
- name: Git config
77+
shell: bash
78+
run: |
79+
git config --system core.longpaths true
80+
81+
- name: Checkout
82+
uses: actions/checkout@v4
83+
with:
84+
fetch-depth: 10
85+
86+
- name: Install Pnpm
87+
run: corepack enable
88+
89+
- uses: dorny/paths-filter@v3
90+
id: changes
91+
with:
92+
predicate-quantifier: 'every'
93+
filters: |
94+
changed:
95+
- "!**/*.md"
96+
- "!**/*.mdx"
97+
- "!**/_meta.json"
98+
- "!**/dictionary.txt"
99+
100+
- name: Setup Node.js ${{ matrix.node-version }}
101+
if: steps.changes.outputs.changed == 'true'
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: ${{ matrix.node-version }}
105+
cache: 'pnpm'
106+
107+
- name: Install Dependencies
108+
if: steps.changes.outputs.changed == 'true'
109+
run: pnpm install && cd ./e2e && npx playwright install
110+
111+
- name: E2E Test
112+
if: steps.changes.outputs.changed == 'true'
113+
run: |
114+
pnpm run test:artifact
115+
pnpm run test:e2e
116+
117+
- name: Examples Test
118+
if: steps.changes.outputs.changed == 'true'
119+
run: |
120+
pnpm run build:examples

0 commit comments

Comments
 (0)