diff --git a/.github/workflows/on-push-pr.yml b/.github/workflows/on-push-pr.yml index bfdcdf9..b9e9713 100644 --- a/.github/workflows/on-push-pr.yml +++ b/.github/workflows/on-push-pr.yml @@ -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