From 95683ab5ef64e05ba1731069b89651b265dd222b Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 22 Jul 2026 09:24:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?ci:=20=E7=A7=BB=E9=99=A4=E6=97=A7=E7=9A=84V?= =?UTF-8?q?alidate=E5=8D=95job=EF=BC=8C=E5=90=AF=E7=94=A83=E4=B8=AA?= =?UTF-8?q?=E5=B9=B6=E8=A1=8CValidate=E5=AD=90job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-pipeline.yml | 97 -------------------------------- 1 file changed, 97 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yml b/.gitea/workflows/ci-pipeline.yml index 2245d06bf..01d610985 100755 --- a/.gitea/workflows/ci-pipeline.yml +++ b/.gitea/workflows/ci-pipeline.yml @@ -76,103 +76,6 @@ jobs: [ -f /tmp/ci_job_start_time ] && START_TIME=$(cat /tmp/ci_job_start_time) python3 scripts/ci/ci_trace_report.py --service xiaoxia-saas-ci --status $STATUS --start-time "$START_TIME" || true - validate: - needs: check-frontend-only - if: always() && needs.check-frontend-only.outputs.skip_backend != 'true' - name: Validate Code Quality And Tests - runs-on: ci-l2 - timeout-minutes: 10 - permissions: - contents: write - env: - DATABASE_URL: postgresql+psycopg://postgres:postgres@host.docker.internal:5432/xiaoxia_saas - USE_IN_MEMORY_DB: 'false' - CI_USE_SHARED_PG: 'true' - steps: - - name: Checkout code - shell: sh - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - curl -sH "Authorization: token $GITHUB_TOKEN" "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/raw/scripts/ci/step_checkout.sh?ref=${GITHUB_SHA}" | bash - - name: Record job start time - shell: sh - run: bash scripts/ci/step_timer_start.sh - - name: Install dependencies - shell: sh - run: | - set -eu - # pip install 带重试(网络不稳定时自动重试) - for i in 1 2 3; do - python3 -m pip install -q -r requirements-base.txt && break - echo "pip install requirements-base.txt 失败,重试 $i/3..." - [ $i -eq 3 ] && exit 1 - sleep 5 - done - for i in 1 2 3; do - python3 -m pip install -q -r requirements.txt && break - echo "pip install requirements.txt 失败,重试 $i/3..." - [ $i -eq 3 ] && exit 1 - sleep 5 - done - for i in 1 2 3; do - python3 -m pip install -q -r requirements-dev.txt && break - echo "pip install requirements-dev.txt 失败,重试 $i/3..." - [ $i -eq 3 ] && exit 1 - sleep 5 - done - for i in 1 2 3; do - python3 -m pip install --no-binary :all: black==26.5.1 isort==8.0.1 && break - echo "pip install black/isort 失败,重试 $i/3..." - [ $i -eq 3 ] && exit 1 - sleep 5 - done - - name: Run all quality checks - shell: bash - env: - GITHUB_TOKEN: ${{ github.token }} - run: bash scripts/ci/run_validate.sh - - name: Auto-fix formatting (black + isort) - if: failure() - shell: sh - env: - GITHUB_TOKEN: ${{ github.token }} - run: python3 scripts/ci/auto_fix_formatting.py - - name: CI failure notification - if: failure() - shell: sh - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - CI_WEBHOOK_URL: ${{ secrets.CI_WEBHOOK_URL }} - run: | - set +e - FAILED_JOB="Validate Code Quality And Tests" python3 scripts/ci_notify_failure.py - - name: Job duration summary - if: always() - shell: sh - run: bash scripts/ci/step_timer_end.sh - - name: Notify on failure - continue-on-error: true - if: failure() - shell: sh - env: - CI_NOTIFY_WEBHOOK: ${{ secrets.CI_NOTIFY_WEBHOOK }} - run: | - set +e - NOTIFY_MODE=failure JOB_NAME="Validate Code Quality And Tests" python3 scripts/ci_notify.py - - name: Report CI trace - if: always() - shell: sh - env: - AGENTLOOP_LICENSE_KEY: ${{ secrets.AGENTLOOP_LICENSE_KEY }} - run: | - STATUS="ok" - [ ${{ job.status }} = "success" ] || STATUS="error" - START_TIME="" - [ -f /tmp/ci_job_start_time ] && START_TIME=$(cat /tmp/ci_job_start_time) - python3 scripts/ci/ci_trace_report.py --service xiaoxia-saas-ci --status $STATUS --start-time "$START_TIME" || true - - validate-code-quality: name: Validate - Code Quality runs-on: ci-l2 -- 2.54.0 From 5e44f3dd1a021dc6fdecfa56fb0702ae738150b7 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 22 Jul 2026 09:25:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20auto-approve/merge=E7=9A=84Validate?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=9B=B4=E6=96=B0=E4=B8=BA3=E4=B8=AA?= =?UTF-8?q?=E5=B9=B6=E8=A1=8C=E5=AD=90job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/pr-automation.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/pr-automation.yml b/.gitea/workflows/pr-automation.yml index 4a06fcd2a..a2bff3f03 100755 --- a/.gitea/workflows/pr-automation.yml +++ b/.gitea/workflows/pr-automation.yml @@ -54,7 +54,9 @@ jobs: CONTEXTS=("CI/CD Pipeline / Frontend Lint (pull_request)") else CONTEXTS=( - "CI/CD Pipeline / Validate Code Quality And Tests (pull_request)" + "CI/CD Pipeline / Validate - Code Quality (pull_request)" + "CI/CD Pipeline / Validate - Type Check (mypy) (pull_request)" + "CI/CD Pipeline / Validate - Migration (alembic) (pull_request)" "CI/CD Pipeline / Frontend Lint (pull_request)" ) fi @@ -233,7 +235,9 @@ jobs: echo "纯前端改动,只检查Frontend Lint" else CONTEXTS=( - "CI/CD Pipeline / Validate Code Quality And Tests (pull_request)" + "CI/CD Pipeline / Validate - Code Quality (pull_request)" + "CI/CD Pipeline / Validate - Type Check (mypy) (pull_request)" + "CI/CD Pipeline / Validate - Migration (alembic) (pull_request)" "CI/CD Pipeline / Frontend Lint (pull_request)" "CI/CD Pipeline / PR Build API Image (pull_request)" "CI/CD Pipeline / PR Build Worker Image (pull_request)" -- 2.54.0 From 83d373c84033fc7812c9b01c484d820537c88f52 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 22 Jul 2026 10:28:17 +0800 Subject: [PATCH 3/3] chore: trigger CI run --- scripts/ci/step_timer_start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci/step_timer_start.sh b/scripts/ci/step_timer_start.sh index 7d4e7c1b0..503143a6d 100755 --- a/scripts/ci/step_timer_start.sh +++ b/scripts/ci/step_timer_start.sh @@ -2,3 +2,4 @@ # CI 公共步骤:Job 开始计时 echo "JOB_START_TIME=$(date +%s)" >> $GITHUB_ENV echo "Job started at $(date)" +# trigger CI run for PR validation \ No newline at end of file -- 2.54.0