Skip to content

Commit 2827803

Browse files
committed
Replace travis
1 parent 0576f28 commit 2827803

13 files changed

+77
-33
lines changed

.github/workflows/build.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [master, v10, v11]
6+
pull_request:
7+
branches: [master, v10, v11]
8+
9+
jobs:
10+
build:
11+
name: build
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
go-version: [1.16.x, 1.17.x]
16+
17+
services:
18+
postgres:
19+
image: postgres:13
20+
env:
21+
POSTGRES_PASSWORD: postgres
22+
options: >-
23+
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
24+
ports:
25+
- 5432:5432
26+
27+
steps:
28+
- name: Set up ${{ matrix.go-version }}
29+
uses: actions/setup-go@v2
30+
with:
31+
go-version: ${{ matrix.go-version }}
32+
33+
- name: Checkout code
34+
uses: actions/checkout@v2
35+
36+
- name: Install hstore
37+
run: PGPASSWORD=postgres psql -U postgres -h localhost -c "CREATE EXTENSION hstore"
38+
39+
- name: Test
40+
run: make test

.github/workflows/release.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: release
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
- name: Release
12+
uses: softprops/action-gh-release@v1
13+
if: startsWith(github.ref, 'refs/tags/')
14+
with:
15+
body: Check CHANGELOG.md for details

.travis.yml

-21
This file was deleted.

Makefile

+1-7
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ all:
1010
cleanTest:
1111
docker rm -fv pg || true
1212

13-
.PHONY: pre-test
14-
pre-test: cleanTest
15-
docker run -d --name pg -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:9.6
16-
sleep 10
17-
docker exec pg psql -U postgres -c "CREATE EXTENSION hstore"
18-
1913
.PHONY: test
20-
test: pre-test
14+
test:
2115
TZ= PGSSLMODE=disable go test ./... -v
2216

2317
tag:

bench_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
func benchmarkDB() *pg.DB {
1717
return pg.Connect(&pg.Options{
1818
User: "postgres",
19+
Password: "postgres",
1920
Database: "postgres",
2021
DialTimeout: 30 * time.Second,
2122
ReadTimeout: 10 * time.Second,

db_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ func TestGinkgo(t *testing.T) {
3434

3535
func pgOptions() *pg.Options {
3636
return &pg.Options{
37+
User: "postgres",
38+
Password: "postgres",
3739
TLSConfig: getTLSConfig(),
3840

3941
MaxRetries: 1,

example_db_model_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ func (s Story) String() string {
3030

3131
func ExampleDB_Model() {
3232
db := pg.Connect(&pg.Options{
33-
User: "postgres",
33+
User: "postgres",
34+
Password: "postgres",
3435
})
3536
defer db.Close()
3637

example_db_query_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ func GetStory(db *pg.DB, id int64) (*Story, error) {
5454

5555
func ExampleDB_Query() {
5656
db := pg.Connect(&pg.Options{
57-
User: "postgres",
57+
User: "postgres",
58+
Password: "postgres",
5859
})
5960

6061
err := createSchema(db)

example_model_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import (
1111

1212
func modelDB() *pg.DB {
1313
db := pg.Connect(&pg.Options{
14-
User: "postgres",
14+
User: "postgres",
15+
Password: "postgres",
1516
})
1617

1718
err := createTestSchema(db)

example_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func panicIf(err error) {
4343
func ExampleConnect() {
4444
db := pg.Connect(&pg.Options{
4545
User: "postgres",
46-
Password: "",
46+
Password: "postgres",
4747
Database: "postgres",
4848
})
4949
defer db.Close()
@@ -115,7 +115,8 @@ func ExampleListener() {
115115

116116
func txExample() *pg.DB {
117117
db := pg.Connect(&pg.Options{
118-
User: "postgres",
118+
User: "postgres",
119+
Password: "postgres",
119120
})
120121

121122
queries := []string{

extra/pgotel/example/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func main() {
2626
db := pg.Connect(&pg.Options{
2727
Addr: ":5432",
2828
User: "postgres",
29+
Password: "postgres",
2930
Database: "example",
3031
})
3132
defer db.Close()

main_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import (
1616
)
1717

1818
func TestUnixSocket(t *testing.T) {
19+
t.Skip()
20+
1921
opt := pgOptions()
2022
opt.Network = "unix"
2123
opt.Addr = "/var/run/postgresql/.s.PGSQL.5432"

version.go

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package pg
2+
3+
// Version is the current release version.
4+
func Version() string {
5+
return "0.0.0"
6+
}

0 commit comments

Comments
 (0)