feat: Enhance CI workflows with health checks and update PostgreSQL image version
Some checks failed
Run Tests / e2e tests (push) Successful in 1m33s
Run Tests / lint tests (push) Failing after 2s
Run Tests / unit tests (push) Failing after 2s

This commit is contained in:
2025-10-27 21:12:46 +01:00
parent dcb08ab1b8
commit 723f6a62b8
3 changed files with 21 additions and 2 deletions

View File

@@ -53,6 +53,8 @@ jobs:
- name: Set up QEMU and Buildx
uses: docker/setup-buildx-action@v3
with:
install: false
- name: Log in to Gitea registry
if: ${{ steps.meta.outputs.on_default == 'true' }}
@@ -72,3 +74,5 @@ jobs:
tags: |
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_ORG }}/${{ env.REGISTRY_IMAGE_NAME }}:latest
${{ env.REGISTRY_URL }}/${{ env.REGISTRY_ORG }}/${{ env.REGISTRY_IMAGE_NAME }}:${{ steps.meta.outputs.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -49,3 +49,16 @@ jobs:
-e DATABASE_NAME=${{ secrets.DATABASE_NAME }} \
-e DATABASE_SCHEMA=${{ secrets.DATABASE_SCHEMA }} \
"$IMAGE_PATH:$IMAGE_SHA"
for attempt in {1..10}; do
if curl -fsS http://localhost:8000/health >/dev/null; then
echo "Deployment health check passed"
exit 0
fi
echo "Health check attempt ${attempt} failed; retrying in 3s"
sleep 3
done
echo "Deployment health check failed after retries" >&2
docker logs calminer >&2 || true
exit 1

View File

@@ -24,7 +24,7 @@ jobs:
target: [unit, e2e, lint]
services:
postgres:
image: postgres:16-alpine
image: postgres:16
env:
POSTGRES_DB: calminer_ci
POSTGRES_USER: calminer
@@ -36,6 +36,7 @@ jobs:
--health-retries 10
steps:
- name: Install Node.js runtime
if: ${{ matrix.target == 'e2e' }}
shell: bash
run: |
set -euo pipefail
@@ -63,8 +64,9 @@ jobs:
- name: Prepare Python environment
uses: ./.gitea/actions/setup-python-env
with:
install-playwright: ${{ matrix.target != 'e2e' }}
install-playwright: ${{ matrix.target == 'e2e' }}
use-system-python: 'true'
run-db-setup: ${{ matrix.target != 'lint' }}
- name: Run tests
run: |