Skip to content

ci: add GitHub Actions for lint/test, PR image build, and GHCR publish - #155

Merged
jaherhum merged 1 commit into
developfrom
feature/ci-actions
Jun 21, 2026
Merged

ci: add GitHub Actions for lint/test, PR image build, and GHCR publish#155
jaherhum merged 1 commit into
developfrom
feature/ci-actions

Conversation

@jaherhum

Copy link
Copy Markdown
Owner

Description

Add GitHub Actions workflows to gate lint/tests, validate the Docker image build on PRs, and publish the image to GHCR on merge to main. Also fixes a pre-existing D101 lint error that would otherwise make the lint gate red on its first run.

Related issue

closes #151
closes #145

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Chore / refactor
  • Documentation
  • Breaking change

Changes

  • .github/workflows/ci.yml (new): runs on PRs to develop/main and pushes to main.
    • lint-test: uv sync --devuv run ruff checkuv run pytest. Tests run with dummy SECRET_KEY/ENCRYPTION_KEY env (settings are instantiated at import). No Postgres service — PG tests are @skip_pg and the rest use mocks.
    • docker-build: builds the repo-root multi-stage Dockerfile with push: false to catch Dockerfile regressions on PRs.
  • .github/workflows/release.yml (new): on push to main, logs in to GHCR with GITHUB_TOKEN, then builds and pushes ghcr.io/jaherhum/crowdroom tagged latest + sha-<commit>.
  • backend/db/models/enum.py: add the missing docstring on ConnectionType (fixes D101).

Testing

  • Tested locally
  • Added/updated tests
  • Tested edge cases

uv run ruff check passes. uv run pytest with dummy env and no .env: 390 passed, 9 skipped. YAML of both workflows validated.

Checklist

  • Code follows project conventions
  • No unnecessary files committed
  • .env and secrets are not included
  • Documentation updated if needed
  • Breaking changes are documented

Additional notes

GHCR auth uses the built-in GITHUB_TOKEN with packages: write — no extra secrets required. The published image reuses the compose wiring from #150/#154. The dummy SECRET_KEY/ENCRYPTION_KEY values in ci.yml are CI-only throwaways, not real secrets.

@jaherhum jaherhum added Priority/Medium The priority is medium Kind/Bug Something is not working Kind/Chore Maintenance, refactor or tooling task labels Jun 21, 2026
@jaherhum jaherhum self-assigned this Jun 21, 2026
Add ci.yml (ruff + pytest gates and a no-push Docker build on PRs to
develop/main and pushes to main) and release.yml (build and push the image
to ghcr.io/jaherhum/crowdroom with latest + sha tags on push to main).

Also add the missing docstring on ConnectionType so ruff check passes,
unblocking the lint gate.

Closes #151
Closes #145
@jaherhum
jaherhum force-pushed the feature/ci-actions branch from 21121ae to 608305d Compare June 21, 2026 22:05
@jaherhum
jaherhum merged commit 917cf11 into develop Jun 21, 2026
2 checks passed
@jaherhum
jaherhum deleted the feature/ci-actions branch June 21, 2026 22:07
@jaherhum jaherhum mentioned this pull request Jun 21, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind/Bug Something is not working Kind/Chore Maintenance, refactor or tooling task Priority/Medium The priority is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant