From 82381a5e938928c381291db38a06d4824c0df70f Mon Sep 17 00:00:00 2001 From: que01 Date: Wed, 21 Oct 2026 12:01:40 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=90=BD=E5=9C=B0=20Gitea=20Actions?= =?UTF-8?q?=20CI=20=E9=97=A8=E7=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 92 +++++++++++++++++++++++++++++++++++++---- docs/ci.md | 30 ++++++++++++++ 2 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 docs/ci.md diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0636dfc..28fb166 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -9,15 +9,91 @@ concurrency: group: ci-${{ github.ref }} cancel-in-progress: true +env: + NODE_VERSION: "24" + PNPM_VERSION: "9.15.0" + jobs: - smoke: - name: Runner smoke + static: + name: Static checks runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 40 steps: - - name: Check runner environment + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: ${{ env.PNPM_VERSION }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm check + - run: pnpm test:api-routes + - run: pnpm validate:templates + - run: pnpm template:compatibility + - run: pnpm --filter @personal-brand/api exec tsx --test test/template-preview-matrix.test.ts + - run: pnpm template:conformance + - run: pnpm template:doctor + + build: + name: Production build + runs-on: ubuntu-latest + timeout-minutes: 60 + needs: [static] + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: ${{ env.PNPM_VERSION }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: pnpm build:admin:preview + - run: pnpm validate:template-release + + api: + name: API integration + runs-on: ubuntu-latest + timeout-minutes: 45 + needs: [static] + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: personal_brand + options: >- + --health-cmd "pg_isready -U postgres -d personal_brand" + --health-interval 5s + --health-timeout 5s + --health-retries 12 + env: + DATABASE_URL: postgresql://postgres:postgres@postgres:5432/personal_brand + DEFAULT_BRAND_ID: 00000000-0000-0000-0000-000000000001 + SESSION_SECRET: ci-integration-session-secret-0123456789abcdef + SEED_ADMIN_PASSWORD: ci-integration-admin-password + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: ${{ env.PNPM_VERSION }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: pnpm + - run: pnpm install --frozen-lockfile + - name: Prepare API test env + working-directory: apps/api run: | - uname -a - node -v - git --version - pwd + cat > .env <