Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/go-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ jobs:
run: >
go test -v
-covermode=atomic
-coverprofile="coverage.out"
-coverprofile="coverage/coverage.out"
./exercises/...

- name: Coverage
run: go tool cover -func="coverage.out"
run: go tool cover -func="coverage/coverage.out"

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.out
path: coverage

codecov:
name: Upload to Codecov
Expand All @@ -63,7 +63,7 @@ jobs:
uses: actions/download-artifact@v5
with:
name: coverage-report
path: coverage.out
path: coverage

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
Expand All @@ -86,7 +86,7 @@ jobs:
uses: actions/download-artifact@v5
with:
name: coverage-report
path: coverage.out
path: coverage

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ COPY ./go.mod ${WORKDIR}/
COPY ./go.sum ${WORKDIR}/
COPY ./Makefile ${WORKDIR}/

RUN mkdir ${WORKDIR}/coverage

# CMD []
###############################################################################
FROM development AS builder
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ format:
$(GO) run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...

coverage.out: env dependencies
$(GOTEST) -v -covermode=atomic -coverprofile="coverage.out" ./exercises/...
$(GOTEST) -v -covermode=atomic -coverprofile="coverage/coverage.out" ./exercises/...

test: env dependencies coverage.out
$(GOCOVER) -func=coverage.out
$(GOCOVER) -func=coverage/coverage.out

coverage: test

coverage/html: coverage.out
$(GOCOVER) -html=coverage.out -o ./coverage/coverage.html
$(GOCOVER) -html=coverage/coverage.out -o ./coverage/coverage.html
open ./coverage/coverage.html

outdated:
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sonar.exclusions=
sonar.tests=exercises
sonar.test.inclusions=**/*_test.go

sonar.go.coverage.reportPaths=coverage.out
sonar.go.coverage.reportPaths=coverage/coverage.out

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
Expand Down