git.iko.soy/typeable/oauth2-proxy
on master help sign in
Set up code coverage within Travis for Code Climate (#533)

* Set up code coverage within Travis for Code Climate * Include CodeClimate badges on ReadMe

commit24cdfa68b6338aad89348b7fc26a1d23b5518fd1 authorJoel Speed <Joel.speed@hotmail.co.uk> dateSun 10 May 2020, 07:29 (6 years ago) parentbe9eaae
5 files changed+17−1
.gitignore+1 .travis.yml+8 CHANGELOG.md+1 Makefile+5−1 README.md+2
.gitignore+1
@@ -6,6 +6,7 @@ release
66*.exe
77.env
88.bundle
9+c.out
910
1011# Go.gitignore
1112# Compiled Object files, Static and Dynamic libs (Shared Objects)
.travis.yml+8
@@ -1,12 +1,20 @@
11language: go
22go:
33 - 1.14.x
4+env:
5+ - COVER=true
46install:
57 # Fetch dependencies
68 - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.24.0
79 - GO111MODULE=on go mod download
10+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11+ - chmod +x ./cc-test-reporter
12+before_script:
13+ - ./cc-test-reporter before-build
814script:
915 - make test
16+after_script:
17+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t gocov
1018sudo: false
1119notifications:
1220 email: false
CHANGELOG.md+1
@@ -25,6 +25,7 @@
2525
2626## Changes since v5.1.1
2727
28+- [#533](https://github.com/oauth2-proxy/oauth2-proxy/pull/487) Set up code coverage within Travis for Code Climate (@JoelSpeed)
2829- [#514](https://github.com/oauth2-proxy/oauth2-proxy/pull/514) Add basic string functions to templates
2930- [#524](https://github.com/oauth2-proxy/oauth2-proxy/pull/524) Sign cookies with SHA256 (@NickMeves)
3031- [#515](https://github.com/oauth2-proxy/oauth2-proxy/pull/515) Drop configure script in favour of native Makefile env and checks (@JoelSpeed)
Makefile+5−1
@@ -13,6 +13,10 @@ MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
1313MINIMUM_SUPPORTED_GO_MINOR_VERSION = 14
1414GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION)
1515
16+ifeq ($(COVER),true)
17+TESTCOVER ?= -coverprofile c.out
18+endif
19+
1620.PHONY: all
1721all: lint $(BINARY)
1822
@@ -65,7 +69,7 @@ docker-push-all: docker-push
6569
6670.PHONY: test
6771test: lint
68− GO111MODULE=on $(GO) test -v -race ./...
72+ GO111MODULE=on $(GO) test $(TESTCOVER) -v -race ./...
6973
7074.PHONY: release
7175release: lint test
README.md+2
@@ -4,6 +4,8 @@
44[![Go Report Card](https://goreportcard.com/badge/github.com/oauth2-proxy/oauth2-proxy)](https://goreportcard.com/report/github.com/oauth2-proxy/oauth2-proxy)
55[![GoDoc](https://godoc.org/github.com/oauth2-proxy/oauth2-proxy?status.svg)](https://godoc.org/github.com/oauth2-proxy/oauth2-proxy)
66[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
7+[![Maintainability](https://api.codeclimate.com/v1/badges/a58ff79407212e2beacb/maintainability)](https://codeclimate.com/github/oauth2-proxy/oauth2-proxy/maintainability)
8+[![Test Coverage](https://api.codeclimate.com/v1/badges/a58ff79407212e2beacb/test_coverage)](https://codeclimate.com/github/oauth2-proxy/oauth2-proxy/test_coverage)
79
810A reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others)
911to validate accounts by email, domain or group.