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 9ad43cd commit bce462a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/on-push-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,39 @@ 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:
mysql:
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
defaults:
run:
shell: bash
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 -U nanodep -d nanodep -f ./storage/psql/schema.sql

- name: setup test dsn
run: echo "NANODEP_PSQL_STORAGE_TEST_DSN=nanodep:nanodep@tcp(localhost:$PORT)/nanodep" >> $GITHUB_ENV

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

0 comments on commit bce462a

Please sign in to comment.