Skip to content

Commit

Permalink
Workaround coverage reporting to codeclimate (#623)
Browse files Browse the repository at this point in the history
Codeclimate's test-reporter does not yet support Github Actions. To
workaround that, we need to make sure we pass the generic `GIT_BRANCH`
and `GIT_COMMIT_SHA` environment variables to the command that generates
the reports in the format codeclimate understands.

Since this information is not available by default in Github Actions, we
do a bit of `git` manipulation to find it.
  • Loading branch information
deivid-rodriguez authored Jan 23, 2020
1 parent 3ec2c6a commit 91cb03b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
bin/rake
- name: Save coverage
run: cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.version }}-${{ matrix.line_editor }}-${{ matrix.compiler }}.json
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/$GITHUB_HEAD_REF:refs/remotes/origin/$GITHUB_HEAD_REF
GIT_BRANCH=$GITHUB_HEAD_REF GIT_COMMIT_SHA=$(git rev-parse origin/$GITHUB_HEAD_REF) cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.version }}-${{ matrix.line_editor }}-${{ matrix.compiler }}.json
- uses: actions/upload-artifact@v1
with:
Expand Down

0 comments on commit 91cb03b

Please sign in to comment.