feat(resolver): implement auto CSS import in AxisUIResolver #88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test, Build and Deploy | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # =============================================== | |
| # 1. 测试任务 (Test Job) | |
| # =============================================== | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. 拉取代码 | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # 2. ⚡️ 修正:必须先安装 pnpm | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| # 3. ⚡️ 修正:后安装 Node.js,这样它才能正确找到 pnpm 缓存 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| # 4. 现在 pnpm 命令才可用 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # ... (lint, type-check, test:ci, codecov... 保持不变) | |
| - name: Run linting | |
| run: pnpm lint | |
| - name: Run type check | |
| run: pnpm type-check | |
| - name: Run tests | |
| run: pnpm test:ci | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage/lcov.info | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| # =============================================== | |
| # 2. 构建任务 (Build Job) | |
| # =============================================== | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| # 1. 拉取代码 | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # 2. ⚡️ 修正:必须先安装 pnpm | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| # 3. ⚡️ 修正:后安装 Node.js | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| # 4. 现在 pnpm 命令才可用 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # 5. 构建所有包 | |
| - name: Build all packages | |
| run: pnpm build:all | |
| - name: Run smoke test | |
| run: pnpm test:smoke | |
| - name: Build docs | |
| run: pnpm docs:build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-files | |
| path: | | |
| packages/components/dist/ | |
| docs/.vitepress/dist/ | |
| retention-days: 7 | |
| # =============================================== | |
| # 3. 部署任务 (Deploy Job) - 修改为直接使用 GitHub Actions 部署到 Pages | |
| # =============================================== | |
| deploy-docs: | |
| name: Deploy Docs to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Download docs artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-files | |
| path: ./build-output | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./build-output/docs/.vitepress/dist/ | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |