diff --git a/src/commands/code_climate_after_build.yml b/src/commands/code_climate_after_build.yml new file mode 100644 index 0000000..4d674f6 --- /dev/null +++ b/src/commands/code_climate_after_build.yml @@ -0,0 +1,8 @@ +description: Sum the coverage files and submit to Code Climate. +steps: + - run: + command: | + ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json" + - deploy: + command: | + ./cc-test-reporter sum-coverage --output - --parts $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input - diff --git a/src/commands/code_climate_before_build.yml b/src/commands/code_climate_before_build.yml new file mode 100644 index 0000000..b59cb58 --- /dev/null +++ b/src/commands/code_climate_before_build.yml @@ -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