Skip to content

Commit

Permalink
ci: create test db automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 22, 2024
1 parent 80b6b06 commit 8a56abc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_DATABASE: s2
- name: Test web server
run: |
./bin/main 8001 &
Expand Down

0 comments on commit 8a56abc

Please sign in to comment.