Skip to content

Commit

Permalink
ci: add codecov.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
aramase committed Apr 20, 2023
1 parent 16a4344 commit 76b329d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Codecov
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions: read-all

jobs:
codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "^1.20"
- name: Run tests
run: make go-test
- uses: codecov/codecov-action@40a12dcee2df644d47232dde008099a3e9e4f865
with:
files: ./cover.out
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ demo/
docs/book/book
__debug_bin
test/e2eprovider/e2e-provider

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ test: go-test

.PHONY: go-test # Run unit tests
go-test:
go test -count=1 -cover $(GO_FILES) -v
cd test/e2eprovider && go test ./... -tags e2e -count=1 -cover -v
go test -count=1 $(GO_FILES) -v -coverprofile cover.out
cd test/e2eprovider && go test ./... -tags e2e -count=1 -v

# skipping Controller tests as this driver only implements Node and Identity service.
.PHONY: sanity-test # Run CSI sanity tests for the driver
Expand Down
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
# Commit status https://docs.codecov.io/docs/commit-status are used
# to block PR based on coverage threshold.
status:
project:
default:
target: auto
threshold: 0%
patch:
default:
informational: true

0 comments on commit 76b329d

Please sign in to comment.