Add support for custom tls.Config #385
This file contains hidden or 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: 'test' | |
| on: | |
| pull_request: | |
| paths: ['**.go', 'go.mod', '.github/workflows/*'] | |
| push: | |
| branches: ['main', 'master'] | |
| jobs: | |
| staticcheck: | |
| name: 'staticcheck' | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - uses: 'actions/checkout@v6' | |
| - uses: 'dominikh/[email protected]' | |
| with: {version: '2025.1.1'} | |
| ubuntu: | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pg: ['14', '15', '16', '17', '18'] | |
| go: ['1.18', '1.25'] | |
| steps: | |
| - uses: 'actions/checkout@v6' | |
| - uses: 'actions/setup-go@v6' | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: 'Start PostgreSQL' | |
| run: | | |
| docker compose up pg${{ matrix.pg }} -d --wait || { | |
| docker compose logs | |
| exit 1 | |
| } | |
| echo '127.0.0.1 postgres postgres-invalid' | sudo tee -a /etc/hosts | |
| - name: 'Run tests' | |
| run: | | |
| echo 'PQTEST_BINARY_PARAMETERS=no go test -race ./...' | |
| PQTEST_BINARY_PARAMETERS=no go test -race ./... | |
| echo 'PQTEST_BINARY_PARAMETERS=yes go test -race ./...' | |
| PQTEST_BINARY_PARAMETERS=yes go test -race ./... | |
| pgbouncer: | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - uses: 'actions/checkout@v6' | |
| - uses: 'actions/setup-go@v6' | |
| with: {go-version: '1.25'} | |
| - name: 'Start PostgreSQL' | |
| run: | | |
| docker compose up pg18 -d --wait || { | |
| docker compose logs | |
| exit 1 | |
| } | |
| docker compose up pgbouncer -d --wait || { | |
| docker compose logs | |
| exit 1 | |
| } | |
| echo '127.0.0.1 postgres postgres-invalid' | sudo tee -a /etc/hosts | |
| - name: 'Run tests' | |
| run: | | |
| echo 'PGPORT=6432 PQTEST_BINARY_PARAMETERS=no go test -race ./...' | |
| PGPORT=6432 PQTEST_BINARY_PARAMETERS=no go test -race ./... | |
| echo PGPORT=6432 'PQTEST_BINARY_PARAMETERS=yes go test -race ./...' | |
| PGPORT=6432 PQTEST_BINARY_PARAMETERS=yes go test -race ./... | |
| # Disabled for now as it's kind of finecky and flaky. | |
| #pgpool: | |
| # runs-on: 'ubuntu-latest' | |
| # steps: | |
| # - uses: 'actions/checkout@v6' | |
| # - uses: 'actions/setup-go@v6' | |
| # with: {go-version: '1.25'} | |
| # - name: 'Start PostgreSQL' | |
| # run: | | |
| # docker compose up pg18 -d --wait || { | |
| # docker compose logs | |
| # exit 1 | |
| # } | |
| # docker compose up pgpool -d --wait || { | |
| # docker compose logs | |
| # exit 1 | |
| # } | |
| # echo '127.0.0.1 postgres postgres-invalid' | sudo tee -a /etc/hosts | |
| # - name: 'Run tests' | |
| # run: | | |
| # echo 'PGPORT=6432 PQTEST_BINARY_PARAMETERS=no go test -race ./...' | |
| # PGPORT=7432 PQTEST_BINARY_PARAMETERS=no go test -race ./... | |
| # echo PGPORT=6432 'PQTEST_BINARY_PARAMETERS=yes go test -race ./...' | |
| # PGPORT=7432 PQTEST_BINARY_PARAMETERS=yes go test -race ./... | |
| # TODO: disabled for now as it's very slow and flaky. | |
| #macos: | |
| # runs-on: 'macos-15-intel' | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # pg: ['18'] | |
| # go: ['1.18', '1.25'] | |
| # steps: | |
| # - uses: 'actions/checkout@v6' | |
| # - uses: 'douglascamata/setup-docker-macos-action@v1' | |
| # - uses: 'actions/setup-go@v6' | |
| # with: | |
| # go-version: ${{ matrix.go }} | |
| # - name: 'Start PostgreSQL' | |
| # run: | | |
| # docker compose up pg${{ matrix.pg }} -d --wait || { | |
| # docker compose logs | |
| # exit 1 | |
| # } | |
| # echo '127.0.0.1 postgres postgres-invalid' | sudo tee -a /etc/hosts | |
| # - name: 'Run tests' | |
| # run: | | |
| # echo 'PQTEST_BINARY_PARAMETERS=no go test -race ./...' | |
| # PQTEST_BINARY_PARAMETERS=no go test -race ./... | |
| # | |
| # echo 'PQTEST_BINARY_PARAMETERS=yes go test -race ./...' | |
| # PQTEST_BINARY_PARAMETERS=yes go test -race ./... | |
| # TODO: can't get this to work; always fails with: | |
| # dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. | |
| # | |
| # Which is a Windows firewall thing. I can't get it to work. | |
| #windows: | |
| # runs-on: 'windows-latest' | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # #go: ['1.18', '1.25'] | |
| # pg: ['18'] | |
| # go: ['1.25'] | |
| # steps: | |
| # - uses: 'actions/checkout@v6' | |
| # - uses: 'Vampire/setup-wsl@v6' | |
| # # ubuntu because Debian doesn't work: https://github.com/Vampire/setup-wsl/issues/76 | |
| # with: {distribution: 'Ubuntu-24.04', additional-packages: 'docker.io docker-compose-v2'} | |
| # - name: 'Start PostgreSQL' | |
| # shell: 'wsl-bash {0}' | |
| # run: | | |
| # docker compose up pg${{ matrix.pg }} -d --wait || { | |
| # docker compose logs | |
| # exit 1 | |
| # } | |
| # echo '127.0.0.1 postgres postgres-invalid' | sudo tee -a /etc/hosts | |
| # - uses: 'actions/setup-go@v6' | |
| # with: | |
| # go-version: ${{ matrix.go }} | |
| # - name: 'Run tests' | |
| # shell: 'bash' | |
| # run: | | |
| # echo 'PQTEST_BINARY_PARAMETERS=no go test -race ./...' | |
| # PQTEST_BINARY_PARAMETERS=no go test -race ./... | |
| # echo 'PQTEST_BINARY_PARAMETERS=yes go test -race ./...' | |
| # PQTEST_BINARY_PARAMETERS=yes go test -race ./... |