Skip to content

Commit

Permalink
Convert to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Nov 22, 2019
1 parent 2aa2ebc commit 7829a6e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 48 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI
on: [push, pull_request]
jobs:
test:
name: Test
strategy:
matrix:
pg-version: ['10', '11']
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Install PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: ${{ matrix.pg-version }}
postgresql db: archiver_test
postgresql user: temba
postgresql password: temba

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x

- name: Run tests
run: go test -p=1 -coverprofile=coverage.text -covermode=atomic ./...

- name: Upload coverage
if: success()
uses: codecov/codecov-action@v1.0.3
with:
token: ${{ secrets.CODECOV_TOKEN }}

release:
name: Release
needs: [test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x

- name: Publish release
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func setup(t *testing.T) *sqlx.DB {
testDB, err := ioutil.ReadFile("testdb.sql")
assert.NoError(t, err)

db, err := sqlx.Open("postgres", "postgres://localhost/archiver_test?sslmode=disable&TimeZone=UTC")
db, err := sqlx.Open("postgres", "postgres://temba:temba@localhost:5432/archiver_test?sslmode=disable&TimeZone=UTC")
assert.NoError(t, err)

_, err = db.Exec(string(testDB))
Expand Down

0 comments on commit 7829a6e

Please sign in to comment.