From 69fd753442eca56348bf0f751346d9f0a03a034f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B1=BC=E7=AB=BF=E9=92=93=E9=B1=BC=E5=B9=B2?= <46661603+PokIsemaine@users.noreply.github.com> Date: Mon, 6 Feb 2023 21:46:06 +0800 Subject: [PATCH] feat: Update README.md badges and CI coverage report (#29) --- .github/workflows/ci.yml | 11 ++++++++++- README.md | 7 ++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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.