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