Skip to content

Commit

Permalink
Add coverage report (#3608)
Browse files Browse the repository at this point in the history
  • Loading branch information
vascoguita authored Jan 16, 2023
1 parent ef15e58 commit 9fb94d6
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ jobs:
with:
go-version-file: go.mod
- name: Check changelog
run: make check-changelog PR=${{ github.event.pull_request.number }}
run: make check-changelog
env:
PR: ${{ github.event.pull_request.number }}
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build ${{ (inputs.push && 'and push') || '' }} ${{ inputs.tags }} Docker image
- name: Build ${{ inputs.push && 'and push' || '' }} ${{ inputs.tags }} Docker image
uses: docker/build-push-action@v3
with:
context: .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- "go.mod"
- "go.sum"
push:
tags-ignore:
branches:
- "*"
workflow_dispatch:

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go environment
id: go
uses: actions/setup-go@v3.3.0
with:
go-version-file: go.mod
- name: Make distribution
run: make dist VERSION=${{ github.ref_name }} GIT_COMMIT=${{ github.sha }} GO_VERSION=$(go version | awk '{print $3}')
run: make dist
env:
VERSION: ${{ github.ref_name }}
GIT_COMMIT: ${{ github.sha }}
GO_VERSION: ${{ steps.go.outputs.go-version }}
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test
on:
pull_request:
push:
tags-ignore:
branches:
- "*"
workflow_dispatch:

Expand Down Expand Up @@ -34,6 +34,15 @@ jobs:
go-version-file: go.mod
- name: Test
run: make test
env:
COVER_PROFILE: ${{ github.event_name == 'push' && 'coverage.out' || '' }}
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
if: github.event_name == 'push'
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.out
force-coverage-parser: go
docker:
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ build-reva-docker: off

.PHONY: test
test: off
go test -race $$(go list ./... | grep -v /tests/integration)
go test $$([[ -z "${COVER_PROFILE}" ]] && echo "" || echo "-coverprofile=${COVER_PROFILE}") -race $$(go list ./... | grep -v /tests/integration)

.PHONY: test-integration
test-integration: build-revad
Expand Down
3 changes: 3 additions & 0 deletions changelog/unreleased/enhancement-coverage-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Add Golang test coverage report for Codacy

https://github.com/cs3org/reva/pull/3608

0 comments on commit 9fb94d6

Please sign in to comment.