From cd7a8586feff5e4a1ee87ecf5eae0b2a94beae43 Mon Sep 17 00:00:00 2001 From: arferreira Date: Wed, 18 Feb 2026 16:51:22 -0500 Subject: [PATCH 1/4] Add API checks to CI --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afbddc4..e8062cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,3 +72,20 @@ jobs: toolchain: "1.88.0" - uses: Swatinem/rust-cache@v2 - run: cargo test + + api: + name: API Checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "1.88.0" + - uses: Swatinem/rust-cache@v2 + - run: cargo install rapina-cli --locked + - run: rapina openapi check + - name: Detect breaking changes + if: github.event_name == 'pull_request' + run: rapina openapi diff --base main From 1c76ffe5c8492a6a9d42db54b15d24b9ea8f4099 Mon Sep 17 00:00:00 2001 From: arferreira Date: Wed, 18 Feb 2026 16:53:39 -0500 Subject: [PATCH 2/4] Start server before API checks in CI --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8062cd..cdf8955 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,23 @@ jobs: api: name: API Checks runs-on: ubuntu-latest + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_USER: reeverb + POSTGRES_PASSWORD: secret + POSTGRES_DB: reeverb_test + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + DATABASE_URL: postgres://reeverb:secret@localhost:5432/reeverb_test + JWT_SECRET: test-secret steps: - uses: actions/checkout@v4 with: @@ -85,6 +102,14 @@ jobs: toolchain: "1.88.0" - uses: Swatinem/rust-cache@v2 - run: cargo install rapina-cli --locked + - run: cargo build --release + - name: Start server + run: | + ./target/release/reeverb & + for i in $(seq 1 30); do + curl -s http://127.0.0.1:3000/health && break + sleep 1 + done - run: rapina openapi check - name: Detect breaking changes if: github.event_name == 'pull_request' From 5c14c75c0342b6ab9c4df70cb2e7be26c2686a6a Mon Sep 17 00:00:00 2001 From: arferreira Date: Wed, 18 Feb 2026 16:58:41 -0500 Subject: [PATCH 3/4] Fix openapi diff by fetching main branch ref --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cdf8955..893f73e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,4 +113,6 @@ jobs: - run: rapina openapi check - name: Detect breaking changes if: github.event_name == 'pull_request' - run: rapina openapi diff --base main + run: | + git fetch origin main + rapina openapi diff --base origin/main From 7aac7e0ed3f94c8673665aa3e250469c841ca311 Mon Sep 17 00:00:00 2001 From: arferreira Date: Wed, 18 Feb 2026 17:08:20 -0500 Subject: [PATCH 4/4] Add prek pre-commit hooks for fmt and clippy --- prek.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 prek.toml diff --git a/prek.toml b/prek.toml new file mode 100644 index 0000000..bb48382 --- /dev/null +++ b/prek.toml @@ -0,0 +1,6 @@ +[[repos]] +repo = "local" +hooks = [ + { id = "fmt", name = "cargo fmt", language = "system", entry = "cargo fmt --all -- --check", pass_filenames = false }, + { id = "clippy", name = "cargo clippy", language = "system", entry = "cargo clippy -- -D warnings", pass_filenames = false, priority = 10 }, +]