mirror of https://github.com/jackc/pgx.git
Replace Travis with Github CI
parent
14050e286d
commit
922508c785
|
@ -0,0 +1,38 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go_version: [1.14, 1.15]
|
||||||
|
pg_version: [9.6, 10, 11, 12, 13]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Set up Go 1.x
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go_version }}
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup database server for testing
|
||||||
|
run: ci/setup_test.bash
|
||||||
|
env:
|
||||||
|
PGVERSION: ${{ matrix.pg_version }}
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -v -race ./...
|
||||||
|
env:
|
||||||
|
PGX_TEST_DATABASE: postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
33
.travis.yml
33
.travis.yml
|
@ -1,33 +0,0 @@
|
||||||
language: go
|
|
||||||
|
|
||||||
go:
|
|
||||||
- 1.15.x
|
|
||||||
- 1.14.x
|
|
||||||
- tip
|
|
||||||
|
|
||||||
# Derived from https://github.com/lib/pq/blob/master/.travis.yml
|
|
||||||
before_install:
|
|
||||||
- ./travis/before_install.bash
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- GO111MODULE=on
|
|
||||||
- PGX_TEST_DATABASE=postgres://pgx_md5:secret@127.0.0.1/pgx_test
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
- CRATEVERSION=2.1 PGX_TEST_CRATEDB_CONN_STRING="host=127.0.0.1 port=6543 user=pgx database=pgx_test"
|
|
||||||
- PGVERSION=12
|
|
||||||
- PGVERSION=11
|
|
||||||
- PGVERSION=10
|
|
||||||
- PGVERSION=9.6
|
|
||||||
- PGVERSION=9.5
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- ./travis/before_script.bash
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./travis/script.bash
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
allow_failures:
|
|
||||||
- go: tip
|
|
|
@ -13,10 +13,6 @@ then
|
||||||
echo "local all postgres trust" > /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
echo "local all postgres trust" > /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
||||||
echo "local all all trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
echo "local all all trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
||||||
echo "host all pgx_md5 127.0.0.1/32 md5" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
echo "host all pgx_md5 127.0.0.1/32 md5" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
||||||
echo "host all pgx_pw 127.0.0.1/32 password" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
|
||||||
echo "hostssl all pgx_ssl 127.0.0.1/32 md5" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
|
||||||
echo "host replication pgx_replication 127.0.0.1/32 md5" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
|
||||||
echo "host pgx_test pgx_replication 127.0.0.1/32 md5" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
|
|
||||||
sudo chmod 777 /etc/postgresql/$PGVERSION/main/postgresql.conf
|
sudo chmod 777 /etc/postgresql/$PGVERSION/main/postgresql.conf
|
||||||
if $(dpkg --compare-versions $PGVERSION ge 9.6) ; then
|
if $(dpkg --compare-versions $PGVERSION ge 9.6) ; then
|
||||||
echo "wal_level='logical'" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
|
echo "wal_level='logical'" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
|
||||||
|
@ -24,6 +20,12 @@ then
|
||||||
echo "max_replication_slots=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
|
echo "max_replication_slots=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
|
||||||
fi
|
fi
|
||||||
sudo /etc/init.d/postgresql restart
|
sudo /etc/init.d/postgresql restart
|
||||||
|
|
||||||
|
psql -U postgres -c 'create database pgx_test'
|
||||||
|
psql -U postgres pgx_test -c 'create extension hstore'
|
||||||
|
psql -U postgres pgx_test -c 'create domain uint64 as numeric(20,0)'
|
||||||
|
psql -U postgres -c "create user pgx_md5 SUPERUSER PASSWORD 'secret'"
|
||||||
|
psql -U postgres -c "create user `whoami`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${CRATEVERSION-}" != "" ]
|
if [ "${CRATEVERSION-}" != "" ]
|
|
@ -1,9 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
if [ "${PGVERSION-}" != "" ]
|
|
||||||
then
|
|
||||||
psql -U postgres -c 'create database pgx_test'
|
|
||||||
psql -U postgres pgx_test -c 'create domain uint64 as numeric(20,0)'
|
|
||||||
psql -U postgres -c "create user pgx_md5 SUPERUSER PASSWORD 'secret'"
|
|
||||||
fi
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
if [ "${PGVERSION-}" != "" ]
|
|
||||||
then
|
|
||||||
go test -v -race ./...
|
|
||||||
elif [ "${CRATEVERSION-}" != "" ]
|
|
||||||
then
|
|
||||||
go test -v -race -run 'TestCrateDBConnect'
|
|
||||||
fi
|
|
Loading…
Reference in New Issue