mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-25 06:05:00 +00:00
- Add workflow_run trigger to ensure tests pass before building/pushing - Add test status check to fail early if tests don't pass - Add pre-build logging steps showing context and tags - Add step IDs to capture build outputs (digest, metadata) - Add comprehensive build summary showing digests and tags - Add GitHub Actions job summary for better UI visibility This ensures: 1. Untested code is never pushed to GHCR 2. Build progress is clearly visible in logs 3. Final artifacts (digests, tags) are easy to find 4. Workflow status can be quickly assessed from summary https://claude.ai/code/session_01Kk7x2VdyXfayHqjuw8rqXe
GitHub Actions Workflows
This directory contains GitHub Actions workflows for CI/CD automation.
Workflows
test.yml
Runs on every push and pull request to ensure code quality:
- Backend Tests: Runs pytest with coverage on Python 3.11 and 3.12
- Requires 70% test coverage minimum
- Uploads coverage reports to Codecov
- Frontend Tests: Lints and builds the Next.js frontend
- Docker Build Test: Validates Docker images can be built successfully
docker-publish.yml
Runs on pushes to main and version tags:
- Builds and pushes Docker images to GitHub Container Registry (GHCR)
- Creates multi-platform images for both backend and frontend
- Tags images with branch name, PR number, version, and commit SHA
create-release.yml
Handles release creation and management
Test Coverage Requirements
Backend tests must maintain at least 70% code coverage. The pipeline will fail if coverage drops below this threshold.
Local Testing
To run tests locally before pushing:
# Backend tests
cd backend
pip install -r requirements.txt -r requirements-dev.txt
pytest --cov=. --cov-report=term-missing
# Frontend build
cd frontend
npm install
npm run build
Adding New Tests
When adding new features:
- Write unit tests in
backend/tests/test_*.py - Ensure all tests pass locally
- Push changes - the CI will automatically run all tests
- Fix any failing tests before merging