git.iko.soy/typeable/oauth2-proxy
on master help sign in
Update CI to separate linting and testing
commitbc93198aa7c312a6dc73a1322abbc6d99f4db7a7 authorJoel Speed <Joel.speed@hotmail.co.uk> dateTue 27 Nov 2018, 11:55 (8 years ago) parent847cf25
4 files changed+24−15
.travis.yml+10−2 CHANGELOG.md+2 lint.sh+11 test.sh+1−13
.travis.yml+10−2
@@ -2,10 +2,18 @@ language: go
22go:
33 - 1.8.x
44 - 1.9.x
5−script:
5+ - 1.10.x
6+install:
7+ # Fetch dependencies
68 - wget -O dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64
79 - chmod +x dep
8− - ./dep ensure
10+ - ./dep ensure --vendor-only
11+script:
12+ # Lint
13+ - go get -u github.com/alecthomas/gometalinter
14+ - gometalinter --install
15+ - ./lint.sh
16+ # Run tests
917 - ./test.sh
1018sudo: false
1119notifications:
CHANGELOG.md+2
@@ -2,6 +2,8 @@
22
33## Changes since v2.2:
44
5+- Update CI scripts to separate linting and testing
6+ - Now using `gometalinter` for linting
57- Move Go import path from `github.com/bitly/oauth2_proxy` to `github.com/pusher/oauth2_proxy`
68- Repository forked on 27/11/18
79 - README updated to include note that this repository is forked
lint.shnew file+11
@@ -0,0 +1,11 @@
1+#!/bin/bash
2+gometalinter --vendor --disable-all \
3+--enable=vet \
4+--enable=vetshadow \
5+--enable=golint \
6+--enable=ineffassign \
7+--enable=goconst \
8+--enable=deadcode \
9+--enable=gofmt \
10+--enable=goimports \
11+--tests ./...
test.sh+1−13
@@ -1,14 +1,2 @@
11#!/bin/bash
2−EXIT_CODE=0
3−echo "gofmt"
4−diff -u <(echo -n) <(gofmt -d $(find . -type f -name '*.go' -not -path "./vendor/*")) || EXIT_CODE=1
5−for pkg in $(go list ./... | grep -v '/vendor/' ); do
6− echo "testing $pkg"
7− echo "go vet $pkg"
8− go vet "$pkg" || EXIT_CODE=1
9− echo "go test -v $pkg"
10− go test -v -timeout 90s "$pkg" || EXIT_CODE=1
11− echo "go test -v -race $pkg"
12− GOMAXPROCS=4 go test -v -timeout 90s0s -race "$pkg" || EXIT_CODE=1
13−done
14−exit $EXIT_CODE
2+go test -v -race $(go list ./... | grep -v /vendor/)