Skip to content

Commit 154167b

Browse files
committed
ci(test): update config
1 parent c8fa194 commit 154167b

File tree

3 files changed

+48
-33
lines changed

3 files changed

+48
-33
lines changed

.github/workflows/test.yml

+35-33
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,51 @@
1-
name: CI-Test
1+
name: Test CI
22

3-
env:
4-
NODE_OPTIONS: --max-old-space-size=6144
5-
6-
on:
7-
push:
8-
paths-ignore:
9-
- 'docs/**'
10-
- '**/demo/*'
11-
- '**/*.md'
3+
on: [push, pull_request]
124

135
jobs:
146
test:
15-
name: "Test"
167
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
mode: ['normal', 'strict']
12+
1713
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v3
20-
with:
21-
fetch-depth: 0
14+
- uses: actions/checkout@v3
2215

23-
- name: Setup Node.js
24-
uses: actions/setup-node@v3
16+
- name: Install pnpm
17+
uses: pnpm/[email protected]
2518
with:
26-
node-version: 14
19+
version: 7
20+
21+
- name: Get pnpm store directory
22+
id: pnpm-cache
23+
run: |
24+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
2725
28-
- name: Cache pnpm modules
26+
- name: Setup pnpm cache
2927
uses: actions/cache@v3
3028
with:
31-
path: ~/.pnpm-store
32-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
30+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
3331
restore-keys: |
34-
${{ runner.os }}-
32+
${{ runner.os }}-pnpm-store-
3533
36-
- name: Pnpm action
37-
uses: pnpm/action-setup@v2
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v3
3836
with:
39-
version: latest
40-
run_install: true
37+
node-version: ${{ matrix.node-version }}
38+
39+
- name: pnpm run intall, build
40+
run: |
41+
pnpm run init
4142
42-
- name: Build
43-
run: pnpm build
43+
- name: test with react normal mode
44+
if: ${{ matrix.mode == 'normal' }}
45+
run: |
46+
pnpm run test
4447
45-
- name: "Test"
46-
run: pnpm test
47-
env:
48-
CI: true
49-
NODE_ENV: test
48+
- name: test with react strict mode
49+
if: ${{ matrix.mode == 'strict' }}
50+
run: |
51+
pnpm run test:strict

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"private": true,
33
"scripts": {
4+
"init": "pnpm install && pnpm run build",
45
"start": "dumi dev",
56
"site": "dumi build",
67
"build": "hooks-scripts turbo --cmd build",
@@ -13,6 +14,7 @@
1314
"entry": "walrus entry",
1415
"jest": "jest",
1516
"test": "jest",
17+
"test:strict": "cross-env REACT_MODE=strict jest",
1618
"test:coverage": "jest --coverage",
1719
"publish": "redbud run ./scripts/publish.ts",
1820
"release:old": "lerna exec --concurrency 1 -- npx --no-install semantic-release -e semantic-release-monorepo",
@@ -87,6 +89,7 @@
8789
"@walrus/package": "^1.1.0",
8890
"@walrus/plugin-release": "1.14.3",
8991
"antd": "5.1.1",
92+
"cross-env": "7.0.3",
9093
"conventional-changelog-cli": "2.2.2",
9194
"conventional-changelog-gitmoji-config": "1.4.4",
9295
"dumi": "2.0.17",

pnpm-lock.yaml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)