Skip to content

Commit

Permalink
chore: add psql test to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
radiohertz committed Nov 5, 2024
1 parent d721094 commit a0052a0
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/on-push-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,38 @@ jobs:
run: echo "NANODEP_MYSQL_STORAGE_TEST_DSN=nanodep:nanodep@tcp(localhost:$PORT)/nanodep" >> $GITHUB_ENV

- run: go test -v ./storage/mysql

psql-test:
runs-on: 'ubuntu-latest'
needs: format-build-test
services:
postgres:
image: postgres:13.16
env:
POSTGRES_DB: nanodep
POSTGRES_USER: nanodep
POSTGRES_PASSWORD: nanodep
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
PGPASSWORD: nanodep
PORT: 5432
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.21.x'

- name: psql schema
run: psql -h localhost -U nanodep -d nanodep -f ./storage/psql/schema.sql

- name: setup test dsn
run: echo "NANODEP_PSQL_STORAGE_TEST_DSN=postgres://nanodep:@localhost/nanodep?sslmode=disable" >> $GITHUB_ENV

- run: go test -v ./storage/psql

0 comments on commit a0052a0

Please sign in to comment.