Skip to content

Commit

Permalink
Merge development into testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Jul 17, 2021
2 parents 90bffeb + 53cc1db commit bd5e675
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests and Code coverage

on:
pull_request:
push:
branches:
- development
- master

jobs:
test-coverage:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.16
- name: Run tests with coverage
run: make test-coverage
- name: Exclude files from coverage report
run: |
filepaths+=" $(find ./ -type f -name '*.go' -exec grep -l 'DONOTCOVER' {} \;)"
filepaths+=" $(find ./ -type f -name '*.pb.go')"
filepaths+=" $(find ./ -type f -name '*.pb.gw.go')"
for filepath in ${filepaths}; do
filepath=$(echo ${filepath} | sed 's/^./github.com\/sentinel-official\/hub/g')
echo "Excluding file ${filepath} from coverage report..."
sed -i "/$(echo ${filepath} | sed 's/\//\\\//g')/d" ./coverage.txt
done
- uses: codecov/[email protected]
with:
file: ./coverage.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.idea/
/vendor/
/build/
/coverage.txt
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ proto-lint:

.PHONY: test
test:
@go test -mod=readonly -v -cover -covermode=atomic ${PACKAGES}
@go test -mod=readonly -timeout 15m -v ${PACKAGES}

.PHONT: test-coverage
test-coverage:
@go test -mod=readonly -timeout 15m -v -covermode=atomic -coverprofile=coverage.txt ${PACKAGES}

.PHONY: tools
tools:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Sentinel Hub

[![Tag](https://img.shields.io/github/tag/sentinel-official/hub.svg)](https://github.com/sentinel-official/hub/releases/latest)
[![Codecov](https://codecov.io/gh/sentinel-official/hub/branch/development/graph/badge.svg)](https://codecov.io/gh/sentinel-official/hub?branch=development)
[![GoReportCard](https://goreportcard.com/badge/github.com/sentinel-official/hub)](https://goreportcard.com/report/github.com/sentinel-official/hub)
[![Licence](https://img.shields.io/github/license/sentinel-official/hub.svg)](https://github.com/sentinel-official/hub/blob/development/LICENSE)
[![LoC](https://tokei.rs/b1/github/sentinel-official/hub)](https://github.com/sentinel-official/hub)
[![Tag](https://img.shields.io/github/tag/sentinel-official/hub.svg)](https://github.com/sentinel-official/hub/releases/latest)

## Installation

Expand Down

0 comments on commit bd5e675

Please sign in to comment.