Skip to content

Commit

Permalink
ci: migrate to github actions (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored Mar 10, 2021
1 parent 786e171 commit c212828
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 87 deletions.
64 changes: 0 additions & 64 deletions .circleci/config.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "Run Tests and Lint Code"

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test-windows:
name: Run Tests on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.16'
- run: |
go test -tags sqlite -failfast -short -timeout=20m $(go list ./... | grep -v sqlcon | grep -v watcherx | grep -v pkgerx | grep -v configx)
shell: bash
test:
name: Run Tests and Lint Code
runs-on: ubuntu-latest
env:
TEST_DATABASE_POSTGRESQL: postgres://test:test@localhost:5432/sqlcon?sslmode=disable
TEST_DATABASE_MYSQL: mysql://root:test@tcp(localhost:3306)/mysql?parseTime=true&multiStatements=true
TEST_DATABASE_COCKROACHDB: cockroach://root@localhost:26257/defaultdb?sslmode=disable
services:
postgres:
image: postgres:11.8
ports:
- 5432:5432
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: sqlcon
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: test
steps:
- name: Start cockroach
run: docker run --name cockroach -p 26257:26257 -d cockroachdb/cockroach:v20.2.5 start-single-node --insecure
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.16.0'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
- name: Prepare nancy dependency list
run: go list -json -m all > go.list
- name: Run nancy
uses: sonatype-nexus-community/nancy-github-action@main
- run: make init
- run: go-acc -o coverage.out ./... -- -v -failfast -timeout=20m -tags sqlite
- name: Convert coverage report to lcov
run: gcov2lcov -infile=coverage.out -outfile=coverage.lcov
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
18 changes: 0 additions & 18 deletions .github/workflows/windows_test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: init
init:
GO111MODULE=on go install ./tools/listx github.com/ory/go-acc github.com/mattn/goveralls github.com/go-bindata/go-bindata/go-bindata github.com/golang/mock/mockgen
GO111MODULE=on go install ./tools/listx github.com/jandelgado/gcov2lcov github.com/ory/go-acc github.com/go-bindata/go-bindata/go-bindata github.com/golang/mock/mockgen

.PHONY: format
format:
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ require (
github.com/gobuffalo/httptest v1.0.2
github.com/gobuffalo/packr v1.22.0
github.com/gobuffalo/pop/v5 v5.3.1
github.com/golang/mock v1.3.1
github.com/google/go-jsonnet v0.16.0
github.com/google/uuid v1.1.2
github.com/gorilla/websocket v1.4.2
github.com/hashicorp/go-retryablehttp v0.6.8
github.com/inhies/go-bytesize v0.0.0-20201103132853-d0aed0d254f8
github.com/jackc/pgconn v1.6.0
github.com/jackc/pgx/v4 v4.6.0
github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08 // indirect
github.com/jmoiron/sqlx v1.2.0
github.com/julienschmidt/httprouter v1.2.0
github.com/knadh/koanf v0.14.1-0.20201201075439-e0853799f9ec
github.com/lib/pq v1.3.0
github.com/markbates/pkger v0.17.1
github.com/mattn/goveralls v0.0.2
github.com/morikuni/aec v1.0.0 // indirect
github.com/opentracing/opentracing-go v1.2.0
github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5
Expand Down
4 changes: 3 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down Expand Up @@ -630,6 +631,8 @@ github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oA
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08 h1:vn5CHED3UxZKIneSxETU9SXXGgsILP8hZHlx+M0u1BQ=
github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU=
Expand Down Expand Up @@ -750,7 +753,6 @@ github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/goveralls v0.0.2 h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
Expand Down
4 changes: 2 additions & 2 deletions go_mod_indirect_pins.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package x

import (
_ "github.com/go-bindata/go-bindata/go-bindata"
_ "github.com/mattn/goveralls"

_ "github.com/gorilla/websocket"
_ "github.com/ory/go-acc"
_"github.com/golang/mock/mockgen"
_ "github.com/jandelgado/gcov2lcov"
)

0 comments on commit c212828

Please sign in to comment.