From 728b6d49d799335046763ca8e19a409896b26d90 Mon Sep 17 00:00:00 2001 From: dullbananas Date: Thu, 23 May 2024 11:52:15 -0700 Subject: [PATCH] create separate database in ci --- .woodpecker.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index be271fe4a..2b921806e 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -133,6 +133,19 @@ steps: - diff config/defaults.hjson config/defaults_current.hjson 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: image: *rust_image environment: @@ -272,5 +285,5 @@ services: database: image: postgres:16-alpine environment: - POSTGRES_USER: lemmy + POSTGRES_USER: postgres POSTGRES_PASSWORD: password