Skip to content

Commit a0052a0

Browse files
committed
chore: add psql test to ci
1 parent d721094 commit a0052a0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/on-push-pr.yml

+35
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,38 @@ jobs:
126126
run: echo "NANODEP_MYSQL_STORAGE_TEST_DSN=nanodep:nanodep@tcp(localhost:$PORT)/nanodep" >> $GITHUB_ENV
127127

128128
- run: go test -v ./storage/mysql
129+
130+
psql-test:
131+
runs-on: 'ubuntu-latest'
132+
needs: format-build-test
133+
services:
134+
postgres:
135+
image: postgres:13.16
136+
env:
137+
POSTGRES_DB: nanodep
138+
POSTGRES_USER: nanodep
139+
POSTGRES_PASSWORD: nanodep
140+
options: >-
141+
--health-cmd pg_isready
142+
--health-interval 10s
143+
--health-timeout 5s
144+
--health-retries 5
145+
ports:
146+
- 5432:5432
147+
env:
148+
PGPASSWORD: nanodep
149+
PORT: 5432
150+
steps:
151+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
152+
153+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
154+
with:
155+
go-version: '1.21.x'
156+
157+
- name: psql schema
158+
run: psql -h localhost -U nanodep -d nanodep -f ./storage/psql/schema.sql
159+
160+
- name: setup test dsn
161+
run: echo "NANODEP_PSQL_STORAGE_TEST_DSN=postgres://nanodep:@localhost/nanodep?sslmode=disable" >> $GITHUB_ENV
162+
163+
- run: go test -v ./storage/psql

0 commit comments

Comments
 (0)