diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..27ea2d4d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: [ github-ci-wip ] + pull_request: + branches: [ github-ci-wip ] + +jobs: + + test: + name: Test + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: secret + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Create hstore extension + run: psql -c 'create extension hstore' + env: + PGHOST: localhost + PGUSER: postgres + PGPASSWORD: secret + PGSSLMODE: disable + + - name: Test + run: go test -v ./... + env: + PGHOST: localhost + PGUSER: postgres + PGPASSWORD: secret + PGSSLMODE: disable diff --git a/README.md b/README.md index 6a68e230..d7238c39 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![](https://godoc.org/github.com/jackc/pgconn?status.svg)](https://godoc.org/github.com/jackc/pgconn) [![Build Status](https://travis-ci.org/jackc/pgconn.svg)](https://travis-ci.org/jackc/pgconn) +![CI](https://github.com/jackc/pgtype/workflows/CI/badge.svg) # pgconn