Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before and after build steps for code climate that handle parallelism #5

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/commands/code_climate_after_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: Sum the coverage files and submit to Code Climate.
parameters:
when:
type: string
default: on_success
steps:
- run:
command: |
./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
when: << parameters.when >>
- deploy:
command: |
./cc-test-reporter sum-coverage --output - --parts $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input -
when: << parameters.when >>
14 changes: 14 additions & 0 deletions src/commands/code_climate_before_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: Install the Code Climate reporter then run before build.
parameters:
version:
type: string
default: latest
steps:
- run:
command: |
if [[ $(command -v cc-test-reporter) == "" ]]; then
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-<< parameters.version >>-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
fi
- run:
command: ./cc-test-reporter before-build