Skip to content

Commit af6c125

Browse files
authored
Use codecov to report coverage (#1314)
1 parent b1035a2 commit af6c125

File tree

6 files changed

+17
-59
lines changed

6 files changed

+17
-59
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
/riff-*.tgz
55
/riff-*.zip
66

7+
# coverage artifacts
8+
/coverage.txt
9+
710
# Eclipe artifacts
811
.project
912
.settings

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ build: $(OUTPUT)
2525
test:
2626
go test ./...
2727

28+
.PHONY: coverage
29+
coverage:
30+
go test -v --race -coverprofile=coverage.txt -covermode=atomic ./...
31+
2832
$(OUTPUT): $(GO_SOURCES) VERSION
2933
go build -o $(OUTPUT) -ldflags "$(LDFLAGS_VERSION)" ./cmd/riff
3034

azure-pipelines.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ jobs:
1717
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
1818
modulePath: '$(build.repository.name)' # Path to the module's code
1919
steps:
20-
- template: ci/unit-test-steps.yml
20+
- template: ci/install-go-steps.yml
21+
- bash: make build coverage verify-docs
22+
workingDirectory: '$(modulePath)'
23+
displayName: 'Run unit test'
24+
- bash: bash <(curl -s https://codecov.io/bash)
25+
env:
26+
CODECOV_TOKEN: '$(CodecovToken)'
27+
workingDirectory: '$(modulePath)'
28+
displayName: 'Report coverage'
29+
2130
displayName: 'Unit test'
2231

2332
- job: fats_lite

ci/install-coverage-steps.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

ci/report-coverage-steps.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

ci/unit-test-steps.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)