feat: GitHub Actions CI pipeline — pytest + ESLint + Trivy#19
Merged
Conversation
CI (all branches + PRs): - backend-test: pytest with real PostgreSQL service container - frontend-lint: ESLint check - docker-build-scan: build both images + Trivy CRITICAL scan week-5 CI/CD phase
CI (all branches + PRs): - backend-test: pytest with real PostgreSQL service container - frontend-lint: ESLint check - docker-build-scan: build both images + Trivy CRITICAL scan CD (main branch only): - push-to-registry: builds and pushes to GHCR - tags: latest + git SHA for traceability Security gate: Trivy blocks on CRITICAL CVEs Tests: health check, missing fields 422, invalid login 401 Week 5 - CI/CD phase
ModuleNotFoundError: No module named 'app' — fixed by setting PYTHONPATH to backend directory so pytest can resolve app imports
…recations - conftest.py: Base.metadata.create_all() before tests, drop_all() after - schemas/auth.py: ConfigDict replaces class-based Config (Pydantic v2) - schemas/result.py: ConfigDict replaces class-based Config (Pydantic v2) - database.py: declarative_base() from sqlalchemy.orm (SQLAlchemy 2.0) All 3 tests should now pass with 0 warnings
- actions/checkout → v4.2.2 - actions/setup-python → v5.3.0 - actions/setup-node → v4.1.0 - actions/cache → v4.2.0 - docker/setup-buildx-action → v3.7.1 - docker/build-push-action → v6.9.0 - docker/login-action → v3.3.0 - Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
GitHub Actions CI/CD pipeline
CI on every push:
CD on main merge:
All 3 jobs passing. 0 warnings.
How to test it?
successfully passes all 3 jobs in action
Checklist
Week / Phase
week-5 CI/CD phase