From 96d4111be2d08be194a30f6420cc662b11731f80 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 11 Oct 2021 16:06:37 +0200 Subject: [PATCH] ci: run PostgreSQL tests --- .build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.build.yml b/.build.yml index 44869c1..0d2afc9 100644 --- a/.build.yml +++ b/.build.yml @@ -2,11 +2,22 @@ image: alpine/edge packages: - go - scdoc + - postgresql sources: - https://git.sr.ht/~emersion/soju tasks: - build: | cd soju - go test -v ./... + go build -v ./... scdoc /dev/null + - setup-postgresql: | + sudo /etc/init.d/postgresql start + sudo -u postgres -- createuser "$USER" + sudo -u postgres -- createdb soju + - test: | + cd soju + export SOJU_TEST_POSTGRES="host=/run/postgresql dbname=soju" + go test -v ./... + - gofmt: | + cd soju test -z $(gofmt -l .)