Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,47 @@ jobs:
toolchain: "1.88.0"
- uses: Swatinem/rust-cache@v2
- run: cargo test

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:
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: 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'
run: |
git fetch origin main
rapina openapi diff --base origin/main
6 changes: 6 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
@@ -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 },
]