Skip to content

Commit f89e4bc

Browse files
authoredJun 2, 2020
add codecov (#102)
* add codecov * add cleaner * add codecov.yaml
1 parent df46bbe commit f89e4bc

File tree

3 files changed

+45
-8
lines changed

3 files changed

+45
-8
lines changed
 

‎.github/workflows/ci.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@ on:
55
- master
66
pull_request:
77
jobs:
8+
cleanup-runs:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: rokroskar/workflow-run-cleanup-action@master
12+
env:
13+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
14+
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
15+
816
Test:
917
runs-on: ubuntu-latest
1018
container: tendermintdev/docker-tm-db-testing
1119
steps:
1220
- uses: actions/checkout@v2
13-
- name: test all dbs
21+
- name: test & coverage report creation
1422
run: |
15-
make test-all
16-
shell: bash
23+
go test ./... -mod=readonly -timeout 8m -race -coverprofile=coverage.txt -covermode=atomic -tags cleveldb,boltdb,rocksdb -v
24+
- uses: codecov/codecov-action@v1
25+
with:
26+
file: ./coverage.txt
27+
fail_ci_if_error: true

‎codecov.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# This codecov.yml is the default configuration for
3+
# all repositories on Codecov. You may adjust the settings
4+
# below in your own codecov.yml in your repository.
5+
#
6+
codecov:
7+
require_ci_to_pass: yes
8+
9+
coverage:
10+
precision: 2
11+
round: down
12+
range: 70...100
13+
14+
status:
15+
# Learn more at https://docs.codecov.io/docs/commit-status
16+
project:
17+
default:
18+
threshold: 1% # allow this much decrease on project
19+
20+
comment:
21+
layout: "reach, diff, files, tree"
22+
behavior: default # update if exists else create new
23+
require_changes: true
24+
25+
ignore:
26+
- "remotedb/proto"

‎makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ all: lint test
1010
## By default this will only test memdb & goleveldb
1111
test:
1212
@echo "--> Running go test"
13-
@go test -p 1 $(PACKAGES) -v
13+
@go test $(PACKAGES) -v
1414

1515
test-cleveldb:
1616
@echo "--> Running go test"
17-
@go test -p 1 $(PACKAGES) -tags cleveldb -v
17+
@go test $(PACKAGES) -tags cleveldb -v
1818

1919
test-rocksdb:
2020
@echo "--> Running go test"
21-
@go test -p 1 $(PACKAGES) -tags rocksdb -v
21+
@go test $(PACKAGES) -tags rocksdb -v
2222

2323
test-boltdb:
2424
@echo "--> Running go test"
25-
@go test -p 1 $(PACKAGES) -tags boltdb -v
25+
@go test $(PACKAGES) -tags boltdb -v
2626

2727
test-all:
2828
@echo "--> Running go test"
29-
@go test -p 1 $(PACKAGES) -tags cleveldb,boltdb,rocksdb -v
29+
@go test $(PACKAGES) -tags cleveldb,boltdb,rocksdb -v
3030

3131
lint:
3232
@echo "--> Running linter"

0 commit comments

Comments
 (0)
Please sign in to comment.