feat(ui): 日期选择器支持月/年下拉直达与快捷预设 #302
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: Verify | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - "scripts/**" | |
| - "drizzle/**" | |
| - "drizzle-sqlite/**" | |
| - ".github/workflows/**" | |
| - "*.ts" | |
| - "*.mts" | |
| - "*.js" | |
| - "*.mjs" | |
| - "*.cjs" | |
| - "*.json" | |
| - "*.yaml" | |
| - "*.yml" | |
| - ".env.example" | |
| - "Dockerfile" | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: [master] | |
| concurrency: | |
| group: verify-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Quality | |
| runs-on: ubuntu-latest | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: | | |
| if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | |
| pnpm install --no-frozen-lockfile | |
| else | |
| pnpm install --frozen-lockfile | |
| fi | |
| - name: ESLint | |
| run: pnpm lint | |
| - name: Prettier Check | |
| run: pnpm format:check | |
| - name: TypeScript Check | |
| run: pnpm exec tsc --noEmit | |
| - name: Unit and component tests with coverage | |
| run: pnpm test:run --coverage --reporter=default --reporter=junit --outputFile=test-report.junit.xml | |
| - name: Upload vitest artifacts | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: vitest-report | |
| path: | | |
| test-report.junit.xml | |
| coverage/lcov.info | |
| if-no-files-found: warn | |
| retention-days: 7 | |
| - name: Upload coverage to Codecov | |
| if: ${{ !cancelled() && env.CODECOV_TOKEN != '' }} | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ env.CODECOV_TOKEN }} | |
| files: coverage/lcov.info | |
| flags: verify | |
| name: verify-coverage | |
| fail_ci_if_error: false | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() && env.CODECOV_TOKEN != '' }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ env.CODECOV_TOKEN }} | |
| files: test-report.junit.xml | |
| flags: verify | |
| build: | |
| name: Production Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: | | |
| if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | |
| pnpm install --no-frozen-lockfile | |
| else | |
| pnpm install --frozen-lockfile | |
| fi | |
| - name: Build application | |
| env: | |
| DB_TYPE: postgres | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| run: pnpm build | |
| migration: | |
| name: Migration Consistency | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: autorouter | |
| POSTGRES_PASSWORD: autorouter | |
| POSTGRES_DB: autorouter | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U autorouter -d autorouter" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 20 | |
| env: | |
| DATABASE_URL: postgresql://autorouter:autorouter@127.0.0.1:5432/autorouter | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: | | |
| if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | |
| pnpm install --no-frozen-lockfile | |
| else | |
| pnpm install --frozen-lockfile | |
| fi | |
| - name: Validate Drizzle artifact consistency | |
| run: pnpm db:check:consistency | |
| - name: Apply migrations on fresh database | |
| run: pnpm db:migrate | |
| - name: Re-apply migrations for idempotency | |
| run: pnpm db:migrate | |
| proxy-stability: | |
| name: Proxy Stability | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: autorouter | |
| POSTGRES_PASSWORD: autorouter | |
| POSTGRES_DB: autorouter | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U autorouter -d autorouter" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 20 | |
| env: | |
| AUTOROUTER_DATABASE_URL: postgresql://autorouter:autorouter@127.0.0.1:5432/autorouter | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: | | |
| if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | |
| pnpm install --no-frozen-lockfile | |
| else | |
| pnpm install --frozen-lockfile | |
| fi | |
| - name: Run proxy stability smoke checks | |
| run: pnpm test:proxy-stability | |
| e2e: | |
| name: Playwright E2E | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: | | |
| if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | |
| pnpm install --no-frozen-lockfile | |
| else | |
| pnpm install --frozen-lockfile | |
| fi | |
| - name: Install Playwright browser and OS dependencies | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Run E2E tests | |
| run: pnpm e2e | |
| - name: Upload Playwright report | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report | |
| path: playwright-report | |
| if-no-files-found: ignore | |
| actionlint: | |
| name: GitHub Actions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Run actionlint | |
| uses: raven-actions/actionlint@v2 | |
| with: | |
| shellcheck: false | |
| verify-status: | |
| name: Verify Status | |
| runs-on: ubuntu-latest | |
| needs: [quality, build, migration, proxy-stability, e2e, actionlint] | |
| if: always() | |
| steps: | |
| - name: Check all jobs | |
| run: | | |
| if [[ "${{ needs.quality.result }}" != "success" ]] || \ | |
| [[ "${{ needs.build.result }}" != "success" ]] || \ | |
| [[ "${{ needs.migration.result }}" != "success" ]] || \ | |
| [[ "${{ needs.proxy-stability.result }}" != "success" ]] || \ | |
| [[ "${{ needs.e2e.result }}" != "success" ]] || \ | |
| [[ "${{ needs.actionlint.result }}" != "success" ]]; then | |
| echo "::error::One or more verification checks failed" | |
| exit 1 | |
| fi | |
| echo "All verification checks passed!" |