Repository navigation
140 lines (117 loc) · 3.75 KB
/
Copy pathtest.yml
File metadata and controls
140 lines (117 loc) · 3.75 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
name: Test
on: [push, pull_request]
jobs:
test-cli:
name: Test CLI on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.19.0', '22.12.0', '24.0.0']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.34.4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test
run: pnpm --filter @zarm-design/cli test --coverage
- name: Coverage
if: matrix.node-version == '20.19.0'
run: bash <(curl -s https://codecov.io/bash)
test-react:
name: Test and build with React ${{ matrix.react }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- react: 16.8.0
react_types: 16.14.68
react_dom_types: 16.9.25
testing_library: 12.1.5
- react: 17.0.2
react_types: 17.0.90
react_dom_types: 17.0.26
testing_library: 12.1.5
- react: 18.3.1
react_types: 18.3.27
react_dom_types: 18.3.7
testing_library: 16.3.2
- react: 19.2.7
react_types: 19.2.17
react_dom_types: 19.2.3
testing_library: 16.3.2
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.34.4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.19.0'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install React compatibility target
run: >
pnpm --filter zarm --filter @zarm-design/icons add --save-dev --lockfile=false
--ignore-scripts
react@${{ matrix.react }} react-dom@${{ matrix.react }}
@types/react@${{ matrix.react_types }} @types/react-dom@${{ matrix.react_dom_types }}
@testing-library/react@${{ matrix.testing_library }}
- name: Lint
if: matrix.react == '19.2.7'
run: pnpm lint
- name: Test
if: matrix.react != '19.2.7'
run: pnpm --filter zarm test && pnpm --filter @zarm-design/icons test
- name: Test with coverage
if: matrix.react == '19.2.7'
run: pnpm --filter zarm coverage && pnpm --filter @zarm-design/icons test
- name: Build
run: pnpm --filter zarm build && pnpm --filter @zarm-design/icons build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Check dist
run: pnpm --filter zarm exec node ./tests/dekko/dist.test.js
- name: Check bundle size
run: pnpm --filter zarm exec node ./tests/bundlesize.test.js
- name: Coverage
if: matrix.react == '19.2.7'
run: bash <(curl -s https://codecov.io/bash)
test-site:
name: Build site with React 19
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.34.4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.19.0'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm --filter site build
env:
NODE_OPTIONS: --max_old_space_size=4096