Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 35 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:

env:
NODE_VERSION: '24'
PNPM_VERSION: '10'

jobs:
# ==================== 变更检测 ====================
Expand Down Expand Up @@ -45,8 +44,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -70,8 +67,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -85,6 +80,32 @@ jobs:
- name: Unit tests
run: pnpm test

# ==================== i18n 检查 ====================
i18n:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check i18n keys
run: pnpm i18n:check

# ==================== 构建检查 ====================
build:
runs-on: ubuntu-latest
Expand All @@ -95,8 +116,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -120,10 +139,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -150,12 +170,12 @@ jobs:
run: pnpm exec playwright install-deps chromium

- name: E2E smoke (Mobile Chrome)
run: pnpm e2e e2e/bioforest-chains.spec.ts --project "Mobile Chrome"
run: pnpm e2e bioforest-chains --project "Mobile Chrome"

# ==================== 最终状态检查 ====================
checks:
runs-on: ubuntu-latest
needs: [typecheck, test, build, e2e]
needs: [typecheck, test, i18n, build, e2e]
if: always()
steps:
- name: Check results
Expand All @@ -168,6 +188,10 @@ jobs:
echo "Tests failed"
exit 1
fi
if [[ "${{ needs.i18n.result }}" == "failure" ]]; then
echo "i18n check failed"
exit 1
fi
if [[ "${{ needs.build.result }}" == "failure" ]]; then
echo "Build failed"
exit 1
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "0.1.0",
"type": "module",
"packageManager": "pnpm@10.22.0",
"scripts": {
"dev": "vite",
"dev:mock": "SERVICE_IMPL=mock vite --port 5174",
Expand All @@ -23,7 +24,8 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"typecheck": "tsc --build --noEmit",
"e2e": "playwright test",
"e2e": "bun scripts/e2e.ts",
"e2e:all": "playwright test",
"e2e:ui": "playwright test --ui",
"e2e:headed": "playwright test --headed",
"e2e:update": "playwright test --update-snapshots",
Expand All @@ -35,7 +37,12 @@
"i18n:extract": "bun scripts/i18n-extract.ts",
"i18n:check": "bun scripts/i18n-check.ts",
"i18n:validate": "bun scripts/i18n-validate.ts",
"agent": "bun scripts/agent-readme.ts"
"agent": "bun scripts/agent-readme.ts",
"turbo:test": "turbo run test",
"turbo:typecheck": "turbo run typecheck",
"turbo:i18n": "turbo run i18n:check",
"turbo:e2e": "turbo run e2e:all",
"turbo:check": "turbo run typecheck test i18n:check"
},
"dependencies": {
"@base-ui/react": "^1.0.0",
Expand Down Expand Up @@ -111,6 +118,7 @@
"shadcn": "^3.6.1",
"storybook": "^10.1.4",
"tailwindcss": "^4.0.0",
"turbo": "^2.7.1",
"typescript": "~5.9.3",
"vite": "^7.2.7",
"vitepress": "^1.6.4",
Expand Down
64 changes: 64 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading