File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 4747 run : |
4848 make test sidecar-test
4949
50+ - name : Archive code coverage results
51+ uses : actions/upload-artifact@v4
52+ with :
53+ name : code-coverage
54+ path : coverage.out # Make sure to use the same file name you chose for the "-coverprofile" in the "make test" step
55+
56+ - name : Archive code coverage results
57+ uses : actions/upload-artifact@v4
58+ with :
59+ name : code-coverage
60+ path : coverage.out # Make sure to use the same file name you chose for the "-coverprofile" in the "make test" step
61+
5062 - name : Run make build
5163 shell : bash
5264 run : |
5365 make build sidecar-build
66+
67+ code_coverage :
68+ name : " Code coverage report"
69+ if : github.event_name == 'pull_request'
70+ runs-on : ubuntu-latest
71+ needs : lint-and-test # Depends on the artifact uploaded by the "lint-and-test" job
72+ permissions :
73+ contents : read
74+ actions : read # to download code coverage results from "lint-and-test" job
75+ pull-requests : write # write permission needed to comment on PR
76+ steps :
77+ - uses : fgrosse/go-coverage-report@v1.2.0
78+ with :
79+ coverage-artifact-name : " code-coverage"
80+ coverage-file-name : " coverage.out"
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ test: test-unit test-e2e ## Run unit tests and e2e tests
9191.PHONY : test-unit
9292test-unit : download-tokenizer install-dependencies # # Run unit tests
9393 @printf " \033[33;1m==== Running Unit Tests ====\033[0m\n"
94- go test -ldflags=" $( LDFLAGS) " -v $$(echo $$(go list ./... | grep -v /test/ ) )
94+ go test -ldflags=" $( LDFLAGS) " -cover -coverprofile=coverage.out - v $$(echo $$(go list ./... | grep -v /test/ ) )
9595
9696.PHONY : test-integration
9797test-integration : download-tokenizer install-dependencies # # Run integration tests
You can’t perform that action at this time.
0 commit comments