codeclimate-action: CodeClimate Report for Go doesn't work
Error
Actions Result URL: https://github.com/toshimaru/nyan/runs/459063904
./cc-reporter after-build --exit-code 0
time="2020-02-20T23:26:31Z" level=error msg="failed to read file github.com/toshimaru/nyan/main.go\nopen github.com/toshimaru/nyan/main.go: no such file or directory"
Error: open github.com/toshimaru/nyan/main.go: no such file or directory
Usage:
cc-test-reporter after-build [flags]
Flags:
-s, --batch-size int batch size for source files (default 500)
-e, --coverage-endpoint string endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
-t, --coverage-input-type string type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
--exit-code int exit code of the test run
-r, --id string reporter identifier (default "f4c78effd3a10a5a45239e6886b35f42475467ad53f09a01002feeb04eb92d5b")
--insecure send coverage insecurely (without HTTPS)
-p, --prefix string the root directory where the coverage analysis was performed (default "/home/runner/work/nyan/nyan")
Global Flags:
-d, --debug run in debug mode
##[error]Error: The process './cc-reporter' failed with exit code 255
##[error]๐จ CC Reporter after-build checkin failed!
(node:2888) UnhandledPromiseRejectionWarning: Error: The process './cc-reporter' failed with exit code 255
at ExecState._setResult (/home/runner/work/_actions/paambaati/codeclimate-action/v2.4.0/node_modules/@actions/exec/lib/toolrunner.js:548:25)
at ExecState.CheckComplete (/home/runner/work/_actions/paambaati/codeclimate-action/v2.4.0/node_modules/@actions/exec/lib/toolrunner.js:531:18)
at ChildProcess.<anonymous> (/home/runner/work/_actions/paambaati/codeclimate-action/v2.4.0/node_modules/@actions/exec/lib/toolrunner.js:431:27)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:2888) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2888) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My Setting
steps:
- uses: actions/setup-go@v2-beta
with:
go-version: '^1.13.8'
...
- uses: paambaati/codeclimate-action@v2.4.0
env:
CC_TEST_REPORTER_ID: ...
with:
coverageCommand: go test ./... -coverprofile c.out
Other information
cc-test-reporter on TravisCI works with the following setting.
...
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- go build .
- go test ./... -coverprofile c.out
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 19 (5 by maintainers)
Commits related to this issue
- Migrate to CodeClimate Action with Go support https://github.com/paambaati/codeclimate-action/issues/109 — committed to ccremer/znapzend-exporter by ccremer 4 years ago
- Change step settings.paambaati/codeclimate-action/issues/109 — committed to YU-K/python-project-50 by YU-K 6 months ago
I figured out more. The code climate reporter really depends on what is configured in go.mod. this example here:
doesnโt work with
The problematic line is
module github.com/ccremer/clustercodein go.mod. If it were justmodule clustercode, then the config works. So I made a little hack by just removing thegithub.com/ccremer/prefix from the cover file:and combine with
coverageCommand: make test_codeclimateNow it works for me.@toshimaru Iโve pushed a fix for this. Can you try
v2.5.3?@toshimaru Why is the prefix empty? For Go itโs needed to give the prefix that is named the same as the directory (I think, or is it the Go module ๐ค )
It worked! ๐ https://github.com/toshimaru/nyan/pull/73/checks?check_run_id=468919116
@paambaati Thanks for you quick work ๐
Seems to work ๐
https://github.com/ccremer/znapzend-exporter/runs/467246099?check_suite_focus=true
@ccremer Sorry, but can you try again? I just pushed a new release.