Support nesting of UPDATE and DELETE #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
# The branches below must be a subset of the branches above | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
# Reference: https://docs.github.com/en/actions/guides/creating-postgresql-service-containers | |
postgres-test: | |
strategy: | |
matrix: | |
go: [1.21.x, 1.20.x] # when updating versions, update it below too. | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: runner | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test_pgq | |
options: >- | |
--name postgres | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
env: | |
INTEGRATION_TESTDB: true | |
PGHOST: localhost | |
PGUSER: runner | |
PGPASSWORD: postgres | |
PGDATABASE: test_pgq | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.x' | |
- name: Run unit tests | |
run: go test -v -race -count 1 -covermode atomic -coverprofile=profile.cov ./... | |
- name: Run Postgres tests | |
working-directory: integration | |
run: go test -v | |
- name: Code coverage | |
if: ${{ github.event_name != 'pull_request' && matrix.go == '1.21.x' }} | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: profile.cov |