5f9538b5ac
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 4s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 3m50s
AI Code Review / AI Code Review (pull_request) Failing after 4m7s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m43s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 4m1s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m19s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m12s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 5m30s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 5m26s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 4m41s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 13m6s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 13m43s
CI/CD Pipeline / CI Gate (pull_request) Failing after 1s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 350h37m32s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 350h37m32s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 350h37m33s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 350h37m33s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 350h49m30s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 350h49m34s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 350h49m38s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 350h49m44s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 350h49m46s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 350h49m48s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 350h49m58s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 350h50m2s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 350h50m15s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 350h50m26s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 350h54m22s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 351h11m50s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 351h11m51s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 351h23m51s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 351h24m19s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 351h24m47s
106 lines
3.1 KiB
YAML
106 lines
3.1 KiB
YAML
name: CI Base Image Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
- main
|
|
paths:
|
|
- 'requirements-base.txt'
|
|
- 'requirements-dev.txt'
|
|
- 'infra/docker/ci.Dockerfile'
|
|
workflow_dispatch:
|
|
inputs:
|
|
reason:
|
|
description: "触发原因"
|
|
required: false
|
|
default: "手动触发 - ci-base 镜像重建"
|
|
|
|
concurrency:
|
|
group: ci-base-image-build
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build-ci-base:
|
|
name: Build CI Base Image
|
|
runs-on: runtime-builder
|
|
timeout-minutes: 60
|
|
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: Docker login to Gitea Registry
|
|
shell: sh
|
|
env:
|
|
GITEA_REGISTRY_USER: xiaoxia
|
|
GITEA_REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
run: |
|
|
set -eu
|
|
for i in 1 2 3; do
|
|
echo "=== Docker login 尝试 $i/3 ==="
|
|
if docker login git.xiaoxiajianji.com -u "${GITEA_REGISTRY_USER}" -p "${GITEA_REGISTRY_TOKEN}"; then
|
|
echo "✅ Docker login successful"
|
|
break
|
|
fi
|
|
echo "❌ Docker login 失败(尝试 $i/3),5s 后重试..."
|
|
sleep 5
|
|
done
|
|
|
|
- name: Build and push CI base image
|
|
shell: sh
|
|
run: |
|
|
set -eu
|
|
IMAGE="git.xiaoxiajianji.com/xiaoxia/xiaoxia-saas/ci-base"
|
|
VERSION_TAG="deps-$(date +%Y%m%d-%H%M)-${GITHUB_SHA::8}"
|
|
|
|
echo "=== Building CI base image (tags: latest, ${VERSION_TAG}) ==="
|
|
docker build --progress=plain \
|
|
-f infra/docker/ci.Dockerfile \
|
|
-t "${IMAGE}:latest" \
|
|
-t "${IMAGE}:${VERSION_TAG}" \
|
|
.
|
|
echo "✅ Image built successfully"
|
|
|
|
echo "=== Pushing ${VERSION_TAG} ==="
|
|
docker push "${IMAGE}:${VERSION_TAG}"
|
|
echo "=== Pushing latest ==="
|
|
docker push "${IMAGE}:latest"
|
|
echo "✅ Pushed to Gitea Registry"
|
|
|
|
- name: Verify image
|
|
shell: sh
|
|
run: |
|
|
set -eu
|
|
IMAGE="git.xiaoxiajianji.com/xiaoxia/xiaoxia-saas/ci-base:latest"
|
|
echo "=== Verifying pinned deps in fresh image ==="
|
|
docker run --rm "${IMAGE}" /opt/xiaoxia-ci-venv/bin/python -c \
|
|
"import httpcore, h2, numpy, httpx; print('VERSIONS:', httpcore.__version__, h2.__version__, numpy.__version__, httpx.__version__)"
|
|
|
|
- name: Notify result
|
|
if: always()
|
|
continue-on-error: true
|
|
shell: sh
|
|
env:
|
|
CI_NOTIFY_WEBHOOK: ${{ secrets.CI_NOTIFY_WEBHOOK }}
|
|
run: |
|
|
set +e
|
|
if [ "${{ job.status }}" = "success" ]; then
|
|
NOTIFY_MODE=success JOB_NAME="CI Base Image Build" python3 scripts/ci_notify.py
|
|
else
|
|
NOTIFY_MODE=failure JOB_NAME="CI Base Image Build" python3 scripts/ci_notify.py
|
|
fi
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
shell: sh
|
|
run: |
|
|
IMAGE="git.xiaoxiajianji.com/xiaoxia/xiaoxia-saas/ci-base"
|
|
docker rmi "${IMAGE}:latest" 2>/dev/null || true
|
|
echo "Cleanup done"
|