Skip to content

Commit

Permalink
Replace Travis with Github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jackc committed Jan 30, 2021
1 parent 14050e2 commit 922508c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 56 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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:[email protected]/pgx_test
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions travis/before_install.bash → ci/setup_test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ then
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 "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
if $(dpkg --compare-versions $PGVERSION ge 9.6) ; then
echo "wal_level='logical'" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
echo "max_wal_senders=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
echo "max_replication_slots=5" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
fi
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

if [ "${CRATEVERSION-}" != "" ]
Expand Down
9 changes: 0 additions & 9 deletions travis/before_script.bash

This file was deleted.

10 changes: 0 additions & 10 deletions travis/script.bash

This file was deleted.

0 comments on commit 922508c

Please sign in to comment.