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