Skip to content

feat: GitHub Actions CI pipeline — pytest + ESLint + Trivy#19

Merged
JashwanthMU merged 5 commits into
developfrom
feature/github-actions-ci
May 27, 2026
Merged

feat: GitHub Actions CI pipeline — pytest + ESLint + Trivy#19
JashwanthMU merged 5 commits into
developfrom
feature/github-actions-ci

Conversation

@JashwanthMU
Copy link
Copy Markdown
Member

@JashwanthMU JashwanthMU commented May 27, 2026

What does this PR do?

GitHub Actions CI/CD pipeline

CI on every push:

  • pytest with PostgreSQL service container
  • ESLint frontend lint
  • Docker build + Trivy CRITICAL scan

CD on main merge:

  • Push images to GHCR with SHA tag

All 3 jobs passing. 0 warnings.

How to test it?

successfully passes all 3 jobs in action

Checklist

  • I tested this locally
  • I wrote or updated relevant docs
  • No secrets or passwords in this code
  • My teammate reviewed this

Week / Phase

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
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
@JashwanthMU JashwanthMU merged commit 9f7c752 into develop May 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant