create separate database in ci

This commit is contained in:
dullbananas 2024-05-23 11:52:15 -07:00 committed by GitHub
parent 0f373563b2
commit 728b6d49d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -133,6 +133,19 @@ steps:
- diff config/defaults.hjson config/defaults_current.hjson - diff config/defaults.hjson config/defaults_current.hjson
when: *slow_check_paths when: *slow_check_paths
# Create database not owned by default user, so `DROP OWNED` works
create_database:
image: postgres:16-alpine
environment:
PGUSER: lemmy
PGPASSWORD: password
PGHOST: database
PGDATABASE: lemmy
commands:
- psql -c "CREATE USER lemmy WITH PASSWORD 'password' SUPERUSER;"
- psql -c "CREATE DATABASE lemmy WITH OWNER lemmy;"
when: *slow_check_paths
check_db_perf_tool: check_db_perf_tool:
image: *rust_image image: *rust_image
environment: environment:
@ -272,5 +285,5 @@ services:
database: database:
image: postgres:16-alpine image: postgres:16-alpine
environment: environment:
POSTGRES_USER: lemmy POSTGRES_USER: postgres
POSTGRES_PASSWORD: password POSTGRES_PASSWORD: password