diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ccc80c..fe6a0e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,16 @@ jobs: - name: pretest run: cd e2e/pretest && ./env_setup.sh - name: Test - run: go test -v ./... -tags e2e + run: go test -v -coverprofile=profile.cov ./... -tags e2e + - name: Install goveralls + env: + GO111MODULE: off + run: go get github.com/mattn/goveralls + + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: goveralls -coverprofile=profile.cov -service=github e2e-test: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 5d15e20..fe1dbc9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # K8s-gatekeeper -[TOC] +[![Go](https://github.com/casbin/k8s-gatekeeper/actions/workflows/ci.yml/badge.svg)](https://github.com/casbin/k8s-gatekeeper/actions/workflows/ci.yml) +[![Coverage Status](https://coveralls.io/repos/github/casbin/k8s-gatekeeper/badge.svg?branch=master)](https://coveralls.io/github/casbin/k8s-gatekeeper?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/casbin/k8s-gatekeeper)](https://goreportcard.com/report/github.com/casbin/k8s-gatekeeper) +[![Godoc](https://godoc.org/github.com/casbin/k8s-gatekeeper?status.svg)](https://godoc.org/github.com/casbin/k8s-gatekeeper) +--- + ## 1.Overview ### 1.1 What is K8s-gatekeeper K8s-gatekeeper is an admission webhook for k8s, using [Casbin](https://casbin.org/docs/en/overview) to apply arbitrary user-defined access control rules to help prevent any operation on k8s which administrator doesn't want.