Skip to content

ci: add postgres service and migration run for tests #28

ci: add postgres service and migration run for tests

ci: add postgres service and migration run for tests #28

Workflow file for this run

name: πŸ§ͺ Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-vertex:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: vaffelbot
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/vaffelbot
steps:
- name: πŸ” Checkout
uses: actions/checkout@v6
- name: πŸ—„οΈ Run migrations
run: cargo sqlx migrate run --source migrations
- name: πŸ§ͺ Run tests
run: cargo test -- --test-threads=1
- name: βœ… Clippy
run: cargo clippy -- -D warnings
- name: πŸ“¦ Build
run: cargo build --release