Skip to content

Commit 35ba9aa

Browse files
committed
chore:update CI workflow
1 parent f9c924c commit 35ba9aa

File tree

3 files changed

+20
-32
lines changed

3 files changed

+20
-32
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ jobs:
2727
with:
2828
fetch-depth: 0 # required for git-diff later
2929

30-
# 2 ▸ Set up pnpm
31-
- uses: pnpm/action-setup@v3
32-
with:
33-
version: 10.12.1
34-
run_install: false
35-
36-
# 3 ▸ Node + pnpm-store cache
30+
# 2 ▸ Node + pnpm-store cache
3731
- uses: actions/setup-node@v4
3832
with:
3933
node-version: 20
4034
cache: pnpm
4135

36+
# 3 ▸ Set up pnpm
37+
- uses: pnpm/action-setup@v3
38+
with:
39+
version: 10.12.1
40+
run_install: false
41+
4242
# 4 ▸ Install deps (deterministic)
4343
- name: Install dependencies
4444
run: pnpm install --frozen-lockfile
@@ -49,42 +49,31 @@ jobs:
4949
uses: actions/cache@v4
5050
with:
5151
path: ~/.cache/ms-playwright
52-
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
52+
key: ${{ runner.os }}-playwright-${{ hashFiles('packages/core/package.json') }}
5353
restore-keys: |
5454
${{ runner.os }}-playwright-
5555
5656
- name: Install Playwright browsers (if cache miss)
5757
if: steps.pw-cache.outputs.cache-hit != 'true'
5858
run: pnpm --filter @react-zero-ui/core exec playwright install --with-deps
5959

60-
- name: Save Playwright cache
61-
if: steps.pw-cache.outputs.cache-hit != 'true'
62-
uses: actions/cache/save@v4
63-
with:
64-
path: ~/.cache/ms-playwright
65-
key: ${{ steps.pw-cache.outputs.cache-primary-key }}
66-
6760
# 6 ▸ Lint fast, fail fast
6861
- name: Lint
6962
run: pnpm lint
7063

71-
# 7 ▸ Install Lockfile
72-
- name: Install Lockfile
73-
run: pnpm install --frozen-lockfile
74-
75-
# 8 ▸ Run Build
64+
# 7 ▸ Run Build
7665
- name: Run Build
7766
run: pnpm build
7867

79-
# 9 ▸ Run Prepack
68+
# 8 ▸ Run Prepack
8069
- name: Run Prepack
8170
run: pnpm prepack:core
8271

83-
# 10 ▸ Run Install Tarball
72+
# 9 ▸ Run Install Tarball
8473
- name: Run Install Tarball
8574
run: pnpm i-tarball
8675

87-
# 11 ▸ Run all tests
76+
# 10 ▸ Run all tests
8877
- name: Run Vite tests
8978
run: pnpm test:vite
9079

@@ -97,5 +86,5 @@ jobs:
9786
- name: Run CLI tests
9887
run: pnpm test:cli
9988

100-
- name: Run unit tests 2
101-
run: pnpm test:unit-2
89+
- name: Run integration tests
90+
run: pnpm test:integration

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
"bootstrap": "pnpm install --frozen-lockfile && pnpm build && pnpm prepack:core && pnpm i-tarball",
1313
"build": "cd packages/core && pnpm build",
1414
"test": "cd packages/core && pnpm test:all",
15-
"test:all": "pnpm install --frozen-lockfile && pnpm prepack:core && pnpm lint && pnpm i-tarball && cd packages/core && pnpm test:all",
1615
"prepack:core": "pnpm -F @react-zero-ui/core pack --pack-destination ./dist",
1716
"i-tarball": "node scripts/install-local-tarball.js",
1817
"test:vite": "cd packages/core && pnpm test:vite",
1918
"test:next": "cd packages/core && pnpm test:next",
19+
"test:integration": "cd packages/core && pnpm test:integration",
2020
"test:unit": "cd packages/core && pnpm test:unit",
21-
"test:unit-2": "cd packages/core && pnpm test:ts",
2221
"test:cli": "cd packages/core && pnpm test:cli",
2322
"format": "prettier --write .",
2423
"lint": "eslint .",
2524
"lint:fix": "eslint . --fix",
25+
"typecheck": "tsc --noEmit",
2626
"size": "npx esbuild ./packages/core/dist/index.js --bundle --minify --format=esm --external:react --define:process.env.NODE_ENV='\"production\"' | gzip -c | wc -c"
2727
},
2828
"devDependencies": {

packages/core/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@
3939
"dev": "tsc -p tsconfig.json --watch",
4040
"test:next": "playwright test -c __tests__/config/playwright.next.config.js",
4141
"test:vite": "playwright test -c __tests__/config/playwright.vite.config.js",
42-
"test:unit": "node --test __tests__/unit/index.test.cjs",
42+
"test:integration": "node --test __tests__/unit/index.test.cjs",
4343
"test:cli": "node --test __tests__/unit/cli.test.cjs",
44-
"test:all": "pnpm run test:vite && pnpm run test:next && pnpm run test:unit && pnpm run test:cli && pnpm run test:ts",
45-
"test": "pnpm run test:all",
46-
"test:ts": "tsx --test src/**/*.test.ts"
44+
"test": "pnpm run test:vite && pnpm run test:next && pnpm run test:unit && pnpm run test:cli && pnpm run test:integration",
45+
"test:unit": "tsx --test src/**/*.test.ts"
4746
},
4847
"keywords": [
4948
"react",
@@ -96,4 +95,4 @@
9695
"lru-cache": "^10.4.3",
9796
"tsx": "^4.20.3"
9897
}
99-
}
98+
}

0 commit comments

Comments
 (0)