From a9bbfda8d203235c38db845282bab19ebec672bc Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Thu, 22 Aug 2024 12:39:07 +0000 Subject: [PATCH] ci: create test db automatically ci: create test db automatically --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ea04fb..a8746cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,17 +25,13 @@ jobs: - name: go test run: | fluentci run --wasm postgres start - pkgx psql --host=localhost -d postgres -U `whoami` -c 'CREATE DATABASE s2;' - pkgx psql --host=localhost -d s2 -U `whoami` -c 'CREATE USER postgres CREATEROLE;' - pkgx psql --host=localhost -d s2 -U `whoami` -c 'GRANT ALL PRIVILEGES ON DATABASE s2 TO postgres;' - pkgx psql --host=localhost -d s2 -U `whoami` -c 'GRANT ALL ON SCHEMA public TO postgres;' - pkgx psql --host=localhost -d s2 -U `whoami` -c 'GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgres;' - pkgx psql --host=localhost -d s2 -U `whoami` -c 'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO postgres;' go install gotest.tools/gotestsum@latest PATH=$HOME/go/bin:$PATH gotestsum --junitfile junit.xml ./... env: GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} NIX_CONFIG: "extra-access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" + POSTGRES_USER: postgres + POSTGRES_DB: s2 - name: Test web server run: | ./bin/main 8001 &