Skip to content

Add Production-Grade CI Pipeline: fmt, clippy -D warnings, Tests with Live Postgres/Redis, sqlx Drift Check, Docker Build, Dependency Audit #337

Description

@Christopherdominic

Summary

This repository has no CI whatsoever.github/workflows/ does not exist. A 53-module Axum/SQLx service with Postgres, Redis, Docker, Helm, and k8s manifests is merged entirely on trust: no fmt, no clippy, no tests, no build verification runs on any PR.

Task

Implement a production-grade GitHub Actions pipeline that runs on every PR and push to main:

  1. ci.yml with parallel jobs:
    • fmtcargo fmt --all --check
    • clippycargo clippy --all-targets --all-features -- -D warnings
    • testcargo test --all-features with Postgres and Redis service containers, running the SQL migrations in migrations/ before the suite; integration tests in tests/ must actually execute, not be skipped
    • sqlx — offline query metadata check (cargo sqlx prepare --check) so schema drift breaks the build, wiring up .sqlx/ metadata if not present
    • dockerdocker build of the production Dockerfile (build-only, no push), with layer caching
  2. audit.ymlcargo audit (or cargo deny check advisories licenses bans) on PRs and on a weekly schedule.
  3. Shared Rust toolchain pinning via rust-toolchain.toml, Swatinem/rust-cache for incremental caching, and a concurrency group cancelling superseded runs.
  4. Total wall-clock under 20 minutes on a warm cache; document the cache strategy in the workflow comments.
  5. Status badges in README.md.

Acceptance criteria

  • All five CI jobs green on your own PR — the pipeline must prove itself
  • Integration tests demonstrably run against real Postgres/Redis services (visible in job logs)
  • cargo sqlx prepare --check fails the build on schema drift (demonstrate once in a draft commit if possible)
  • Clippy passes with -D warnings — fix any warnings this surfaces rather than allow-listing them
  • Weekly dependency audit scheduled

PR requirements (mandatory)

  • ✅ Your PR must pass all checks — PRs with failing or skipped checks will not be merged.
  • 📸 You must attach a screenshot in the PR description demonstrating the result (for this issue: the green Actions run summary showing every job passing).
  • 🔗 You must link this issue number in your PR description (e.g. Closes #<issue-number>). PRs without a linked issue will not be reviewed.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26ci/cdContinuous integration and deliverydifficulty: very hardRequires deep expertise and substantial efforttestingTest coverage, fuzzing, property testing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions