refactor(backend): standardize errors and simplify configuration and test setup
This commit is contained in:
1 parent
1535c19b8c
commit
138666a7bb
92 files changed
+3994
-210
No files matched your search
+103
-1
@@ -77,7 +77,33 @@ jobs:
|
||||
run: make -C backend check
|
||||
- name: Run backend race tests
|
||||
run: make -C backend test-race
|
||||
- name: Run PostgreSQL integration tests
|
||||
|
||||
integration:
|
||||
name: Integration tests (${{ matrix.shard }}/2)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
shard: [1, 2]
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
||||
with:
|
||||
go-version-file: backend/go.mod
|
||||
cache: true
|
||||
cache-dependency-path: backend/go.sum
|
||||
- name: Install Go dependencies
|
||||
run: make -C backend deps
|
||||
- name: Run PostgreSQL, Redis, and SeaweedFS integration shard
|
||||
env:
|
||||
TEST_SHARD_INDEX: ${{ matrix.shard }}
|
||||
TEST_SHARD_TOTAL: "2"
|
||||
GOFLAGS: -race
|
||||
run: make -C backend test-int
|
||||
|
||||
frontend:
|
||||
@@ -187,10 +213,75 @@ jobs:
|
||||
- name: Build the separate ML image
|
||||
run: make -C deploy ml-build
|
||||
|
||||
security:
|
||||
name: Source security checks
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Check out source and history
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
||||
with:
|
||||
go-version-file: backend/go.mod
|
||||
cache: true
|
||||
cache-dependency-path: backend/go.sum
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
|
||||
with:
|
||||
python-version-file: ml/.python-version
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
||||
with:
|
||||
version: 0.12.22
|
||||
enable-cache: false
|
||||
- name: Install security tools
|
||||
run: make -C security install
|
||||
- name: Check scanner rules and source
|
||||
run: make -C security test check
|
||||
- name: Upload security reports
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: security-source-reports
|
||||
path: security/reports/
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
security-images:
|
||||
name: Container security checks
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
|
||||
with:
|
||||
python-version-file: ml/.python-version
|
||||
- name: Install Trivy
|
||||
run: make -C security install-trivy
|
||||
- name: Build and scan service images
|
||||
run: make -C security images
|
||||
- name: Upload container security reports
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: security-image-reports
|
||||
path: security/reports/
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
smoke:
|
||||
name: Isolated technical smoke
|
||||
needs:
|
||||
- backend
|
||||
- integration
|
||||
- frontend
|
||||
- infrastructure
|
||||
runs-on: ubuntu-24.04
|
||||
@@ -209,30 +300,41 @@ jobs:
|
||||
needs:
|
||||
- api
|
||||
- backend
|
||||
- integration
|
||||
- frontend
|
||||
- ml
|
||||
- codegen
|
||||
- infrastructure
|
||||
- smoke
|
||||
- security
|
||||
- security-images
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Require every CI job to pass
|
||||
env:
|
||||
API_RESULT: ${{ needs.api.result }}
|
||||
BACKEND_RESULT: ${{ needs.backend.result }}
|
||||
INTEGRATION_RESULT: ${{ needs.integration.result }}
|
||||
FRONTEND_RESULT: ${{ needs.frontend.result }}
|
||||
ML_RESULT: ${{ needs.ml.result }}
|
||||
CODEGEN_RESULT: ${{ needs.codegen.result }}
|
||||
INFRASTRUCTURE_RESULT: ${{ needs.infrastructure.result }}
|
||||
SMOKE_RESULT: ${{ needs.smoke.result }}
|
||||
SECURITY_RESULT: ${{ needs.security.result }}
|
||||
SECURITY_IMAGES_RESULT: ${{ needs.security-images.result }}
|
||||
run: |
|
||||
printf 'api=%s backend=%s frontend=%s ml=%s codegen=%s infrastructure=%s smoke=%s\n' \
|
||||
"$API_RESULT" "$BACKEND_RESULT" "$FRONTEND_RESULT" "$ML_RESULT" \
|
||||
"$CODEGEN_RESULT" "$INFRASTRUCTURE_RESULT" "$SMOKE_RESULT"
|
||||
test "$API_RESULT" = success
|
||||
test "$BACKEND_RESULT" = success
|
||||
printf 'integration=%s\n' "$INTEGRATION_RESULT"
|
||||
test "$INTEGRATION_RESULT" = success
|
||||
test "$FRONTEND_RESULT" = success
|
||||
test "$ML_RESULT" = success
|
||||
test "$CODEGEN_RESULT" = success
|
||||
test "$INFRASTRUCTURE_RESULT" = success
|
||||
test "$SMOKE_RESULT" = success
|
||||
printf 'security=%s security-images=%s\n' "$SECURITY_RESULT" "$SECURITY_IMAGES_RESULT"
|
||||
test "$SECURITY_RESULT" = success
|
||||
test "$SECURITY_IMAGES_RESULT" = success
|
||||
Reference in new issue
Block a user