fix(transform): 适配 SubStore upstream 源码结构变更 #7
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: API Smoke Test | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| - 'docs/**' | |
| - '*.md' | |
| pull_request: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| - 'docs/**' | |
| - '*.md' | |
| workflow_dispatch: | |
| jobs: | |
| test-workers: | |
| runs-on: ubuntu-latest | |
| name: Workers API Test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: latest | |
| - name: Fetch Sub-Store source | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: bash scripts/fetch-substore.sh | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Install backend dependencies | |
| run: pnpm run install:backend | |
| - name: Configure wrangler.toml | |
| run: | | |
| cp wrangler.toml.example wrangler.toml | |
| sed -i 's/__JWT_SECRET__/test-jwt-secret-for-ci-testing-32chars/g' wrangler.toml | |
| - name: Start dev server | |
| run: | | |
| pnpm run dev:workers > workers-dev.log 2>&1 & | |
| echo "DEV_PID=$!" >> "$GITHUB_ENV" | |
| - name: Wait for server | |
| uses: iFaxity/wait-on-action@v1.2.1 | |
| with: | |
| resource: http-get://127.0.0.1:3000/api/dashboard/settings/public | |
| timeout: 120000 | |
| interval: 1000 | |
| httpTimeout: 10000 | |
| log: true | |
| - name: Print Workers dev log on failure | |
| if: failure() | |
| run: | | |
| cat workers-dev.log || true | |
| - name: Run API tests | |
| run: node scripts/test-dashboard.js http://localhost:3000 | |
| - name: Stop dev server | |
| if: always() | |
| run: | | |
| kill "$DEV_PID" 2>/dev/null || true | |
| pkill -f "vite" 2>/dev/null || true | |
| test-deno: | |
| runs-on: ubuntu-latest | |
| name: Deno API Test | |
| env: | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres | |
| services: | |
| postgres: | |
| image: postgres:18-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Fetch Sub-Store source | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: bash scripts/fetch-substore.sh | |
| - name: Install dependencies | |
| run: deno install | |
| - name: Install backend dependencies | |
| run: deno task install:backend | |
| - name: Build dashboard | |
| run: deno task build:dashboard | |
| - name: Run database migration | |
| run: deno task migrate | |
| - name: Start Deno server | |
| env: | |
| PORT: '8000' | |
| JWT_SECRET: test-jwt-secret-for-ci-testing-32chars | |
| run: | | |
| deno task dev > deno-dev.log 2>&1 & | |
| echo "DEV_PID=$!" >> "$GITHUB_ENV" | |
| - name: Wait for server | |
| uses: iFaxity/wait-on-action@v1.2.1 | |
| with: | |
| resource: http-get://127.0.0.1:8000/api/dashboard/settings/public | |
| timeout: 120000 | |
| interval: 1000 | |
| httpTimeout: 10000 | |
| log: true | |
| - name: Print Deno dev log on failure | |
| if: failure() | |
| run: | | |
| cat deno-dev.log || true | |
| - name: Run API tests | |
| run: node scripts/test-dashboard.js http://localhost:8000 | |
| - name: Stop Deno server | |
| if: always() | |
| run: kill "$DEV_PID" 2>/dev/null || true |