Skip to content

Code Coverage with Code Climate #26027

Answered by ethomson
ksylvest asked this question in Actions
Discussion options

You must be logged in to vote

I’m afraid that we don’t set the GIT_BRANCH environment variable.  We do, however, set the GITHUB_REF variable, which should be able to be used.  You should be able to remove the leading refs/heads/ prefix from that variable and set it to GIT_BRANCH.  For example:

export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"

curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov coverage/lcov.info
./cc-test-reporter upload-coverage

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants