Set up code coverage within Travis for Code Climate (#533)

* Set up code coverage within Travis for Code Climate
* Include CodeClimate badges on ReadMe
This commit is contained in:
Joel Speed 2020-05-10 07:29:37 +01:00 committed by GitHub
parent be9eaaeb48
commit 24cdfa68b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 1 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ release
*.exe
.env
.bundle
c.out
# Go.gitignore
# Compiled Object files, Static and Dynamic libs (Shared Objects)

View File

@ -1,12 +1,20 @@
language: go
go:
- 1.14.x
env:
- COVER=true
install:
# Fetch dependencies
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.24.0
- GO111MODULE=on go mod download
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
before_script:
- ./cc-test-reporter before-build
script:
- make test
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t gocov
sudo: false
notifications:
email: false

View File

@ -25,6 +25,7 @@
## Changes since v5.1.1
- [#533](https://github.com/oauth2-proxy/oauth2-proxy/pull/487) Set up code coverage within Travis for Code Climate (@JoelSpeed)
- [#514](https://github.com/oauth2-proxy/oauth2-proxy/pull/514) Add basic string functions to templates
- [#524](https://github.com/oauth2-proxy/oauth2-proxy/pull/524) Sign cookies with SHA256 (@NickMeves)
- [#515](https://github.com/oauth2-proxy/oauth2-proxy/pull/515) Drop configure script in favour of native Makefile env and checks (@JoelSpeed)

View File

@ -13,6 +13,10 @@ MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 14
GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION)
ifeq ($(COVER),true)
TESTCOVER ?= -coverprofile c.out
endif
.PHONY: all
all: lint $(BINARY)
@ -65,7 +69,7 @@ docker-push-all: docker-push
.PHONY: test
test: lint
GO111MODULE=on $(GO) test -v -race ./...
GO111MODULE=on $(GO) test $(TESTCOVER) -v -race ./...
.PHONY: release
release: lint test

View File

@ -4,6 +4,8 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/oauth2-proxy/oauth2-proxy)](https://goreportcard.com/report/github.com/oauth2-proxy/oauth2-proxy)
[![GoDoc](https://godoc.org/github.com/oauth2-proxy/oauth2-proxy?status.svg)](https://godoc.org/github.com/oauth2-proxy/oauth2-proxy)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![Maintainability](https://api.codeclimate.com/v1/badges/a58ff79407212e2beacb/maintainability)](https://codeclimate.com/github/oauth2-proxy/oauth2-proxy/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/a58ff79407212e2beacb/test_coverage)](https://codeclimate.com/github/oauth2-proxy/oauth2-proxy/test_coverage)
A reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others)
to validate accounts by email, domain or group.