2023-11-13 13:50:32 +01:00
|
|
|
name: Run tests
|
2023-11-10 21:08:02 +01:00
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres
|
|
|
|
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_DB: postgres
|
|
|
|
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-11-13 13:50:32 +01:00
|
|
|
- name: Build executable
|
2023-11-10 21:08:02 +01:00
|
|
|
run: cargo build --verbose
|
|
|
|
- name: Run tests
|
2023-11-10 22:15:17 +01:00
|
|
|
run: cargo test --verbose -- --test-threads=1
|
2023-11-10 21:08:02 +01:00
|
|
|
env:
|
|
|
|
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
|
|
|
|
PORT: 8080
|
|
|
|
|