Skip to content

Commit

Permalink
fix: lint and test stage
Browse files Browse the repository at this point in the history
Signed-off-by: Otieno Calvine <nyarangaotieno@gmail.com>
  • Loading branch information
NYARAS committed Jul 29, 2021
1 parent 43eaa6f commit ae8ea53
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
OPENCONCEPTLAB_TOKEN: ${{ secrets.OPENCONCEPTLAB_TOKEN }}
OPENCONCEPTLAB_API_URL: ${{ secrets.OPENCONCEPTLAB_API_URL }}
JWT_KEY: ${{ secrets.JWT_KEY }}
CLOUD_HEALTH_FHIRSTORE_ID: ${{ secrets.CLOUD_HEALTH_FHIRSTORE_ID }}

jobs:
lint_and_test:
Expand Down Expand Up @@ -51,6 +52,7 @@ jobs:
go get -u github.com/gordonklaus/ineffassign
go get github.com/fzipp/gocyclo
go get github.com/stretchr/testify/assert@v1.7.0
go get github.com/ory/go-acc
- name: Run lint and test
run: |
Expand All @@ -61,12 +63,12 @@ jobs:
errcheck -ignore 'os:.*,' $(go list ./... | grep -v /vendor/)
misspell -error .
gosec -exclude=G304,G101 ./...
touch ./coverage.out
echo 'mode: atomic' > coverage.txt
go list ./... | grep -v "generated.go" coverage.txt | grep -v "_gen.go" | grep -v "mocks.go" | grep -v "*resolver*go" | grep -v "server.go" | xargs -n1 -I{} sh -c 'go test -timeout 99999s -coverprofile=coverage.out -coverpkg $(go list ./... | grep -v /vendor | tr "\n" ",") {} && tail -n +2 coverage.out >> coverage.txt || exit 255' && rm coverage.out
go tool cover -html=coverage.txt -o coverage.html
gocov convert coverage.txt > coverage.json
go-acc -o coverage.txt --ignore generated,cmd ./... -- -timeout 60m
grep -v "generated.go" coverage.txt | grep -v "_gen.go" | grep -v "mocks.go" | grep -v "*resolver*go" | grep -v "server.go" > coverage.out
go tool cover -html=coverage.out -o coverage.html
gocov convert coverage.out > coverage.json
gocov report coverage.json > coverage_report.txt
tail coverage_report.txt
- name: Install goveralls
env:
Expand Down

0 comments on commit ae8ea53

Please sign in to comment.