mirror of https://github.com/jackc/pgx.git
Add CockroachDB to CI
parent
9e55cff611
commit
d46e447a39
|
@ -10,19 +10,32 @@ jobs:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go_version: [1.14, 1.15]
|
go-version: [1.15, 1.16]
|
||||||
pg_version: [9.6, 10, 11, 12, 13]
|
pg-version: [9.6, 10, 11, 12, 13, cockroachdb]
|
||||||
|
include:
|
||||||
|
- pg-version: 9.6
|
||||||
|
pgx-test-database: postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
||||||
|
- pg-version: 10
|
||||||
|
pgx-test-database: postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
||||||
|
- pg-version: 11
|
||||||
|
pgx-test-database: postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
||||||
|
- pg-version: 12
|
||||||
|
pgx-test-database: postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
||||||
|
- pg-version: 13
|
||||||
|
pgx-test-database: postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
||||||
|
- pg-version: cockroachdb
|
||||||
|
pgx-test-database: "postgresql://root@127.0.0.1:26257/pgx_test?sslmode=disable&experimental_enable_temp_tables=on"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go_version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -30,9 +43,9 @@ jobs:
|
||||||
- name: Setup database server for testing
|
- name: Setup database server for testing
|
||||||
run: ci/setup_test.bash
|
run: ci/setup_test.bash
|
||||||
env:
|
env:
|
||||||
PGVERSION: ${{ matrix.pg_version }}
|
PGVERSION: ${{ matrix.pg-version }}
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: go test -v -race ./...
|
run: go test -v -race ./...
|
||||||
env:
|
env:
|
||||||
PGX_TEST_DATABASE: postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
PGX_TEST_DATABASE: ${{ matrix.pgx-test-database }}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
if [ "${PGVERSION-}" != "" ]
|
if [[ "${PGVERSION-}" =~ ^[0-9.]+$ ]]
|
||||||
then
|
then
|
||||||
sudo apt-get remove -y --purge postgresql libpq-dev libpq5 postgresql-client-common postgresql-common
|
sudo apt-get remove -y --purge postgresql libpq-dev libpq5 postgresql-client-common postgresql-common
|
||||||
sudo rm -rf /var/lib/postgresql
|
sudo rm -rf /var/lib/postgresql
|
||||||
|
@ -28,6 +28,14 @@ then
|
||||||
psql -U postgres -c "create user `whoami`"
|
psql -U postgres -c "create user `whoami`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${PGVERSION-}" =~ ^cockroach ]]
|
||||||
|
then
|
||||||
|
wget -qO- https://binaries.cockroachdb.com/cockroach-v20.2.5.linux-amd64.tgz | tar xvz
|
||||||
|
sudo mv cockroach-v20.2.5.linux-amd64/cockroach /usr/local/bin/
|
||||||
|
cockroach start-single-node --insecure --background --listen-addr=localhost
|
||||||
|
cockroach sql --insecure -e 'create database pgx_test'
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${CRATEVERSION-}" != "" ]
|
if [ "${CRATEVERSION-}" != "" ]
|
||||||
then
|
then
|
||||||
docker run \
|
docker run \
|
||||||
|
|
Loading…
Reference in New Issue