-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from codacy/jose-melo/feat/circleci-orbs
Add coverage reporter orb
- Loading branch information
Showing
5 changed files
with
111 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codacy: codacy/[email protected] | ||
codacy: codacy/[email protected] | ||
|
||
references: | ||
circleci_job: &circleci_job | ||
docker: | ||
- image: circleci/circleci-cli:0.1.5879 | ||
working_directory: ~/workdir | ||
|
||
jobs: | ||
publish_circleci_artifacts: | ||
|
@@ -13,12 +19,54 @@ jobs: | |
- store_artifacts: | ||
path: ~/workdir/artifacts/ | ||
|
||
pack_and_validate: | ||
<<: *circleci_job | ||
steps: | ||
- attach_workspace: | ||
at: ~/workdir | ||
- run: | ||
name: Pack orb | ||
command: | | ||
echo "" >> orbs/examples/codacy-coverage-report.yml | ||
echo " orbs:" >> orbs/examples/codacy-coverage-report.yml | ||
echo " coverage-reporter: codacy/coverage-reporter@$(cat .version)" >> orbs/examples/codacy-coverage-report.yml | ||
circleci config pack orbs > orb.yml | ||
- run: | ||
name: Validate orb | ||
command: circleci orb validate orb.yml | ||
- persist_to_workspace: | ||
root: ~/workdir | ||
paths: | ||
- "orb.yml" | ||
|
||
publish_dev: | ||
<<: *circleci_job | ||
steps: | ||
- attach_workspace: | ||
at: ~/workdir | ||
- deploy: | ||
name: Publish orb as dev (deleted after 90 days) | ||
command: circleci orb publish orb.yml codacy/coverage-reporter@dev:$(cat .version) --token $CIRCLE_TOKEN | ||
|
||
publish_prod: | ||
<<: *circleci_job | ||
steps: | ||
- attach_workspace: | ||
at: ~/workdir | ||
- deploy: | ||
name: Publish final orb | ||
command: circleci orb publish orb.yml codacy/coverage-reporter@$(cat .version) --token $CIRCLE_TOKEN | ||
|
||
workflows: | ||
version: 2 | ||
compile_test_deploy: | ||
jobs: | ||
- codacy/checkout_and_version: | ||
write_sbt_version: true | ||
- pack_and_validate: | ||
context: CodacyCircleCI | ||
requires: | ||
- codacy/checkout_and_version | ||
- codacy/sbt: | ||
name: populate_cache | ||
cmd: sbt ";set scalafmtUseIvy in ThisBuild := false;update" | ||
|
@@ -83,10 +131,24 @@ workflows: | |
- codacy/publish_ghr: | ||
name: publish_ghr | ||
path: ~/workdir/artifacts/ | ||
context: CodacyGitHub | ||
requires: | ||
- publish | ||
- publish_dev: | ||
context: CodacyCircleCI | ||
requires: | ||
- publish_ghr | ||
- pack_and_validate | ||
filters: | ||
branches: | ||
ignore: | ||
- master | ||
- publish_prod: | ||
context: CodacyCircleCI | ||
requires: | ||
- publish_ghr | ||
- pack_and_validate | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
context: CodacyGitHub | ||
requires: | ||
- publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: 2.1 | ||
|
||
description: > | ||
Orb to send Codacy coverage reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
description: "Download Codacy's coverage reporter and run it" | ||
|
||
parameters: | ||
tool_version: | ||
type: string | ||
default: latest | ||
description: "Specify Codacy's coverage reporter tool version" | ||
steps: | ||
- run: | ||
command: | | ||
export CODACY_REPORTER_VERSION=<< parameters.tool_version >> | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
description: Send coverage report to Codacy | ||
usage: | ||
jobs: | ||
codacy-coverage-report: | ||
docker: | ||
- image: circleci/openjdk:8-jdk | ||
steps: | ||
- checkout | ||
- "run commands to generate the coverage result" | ||
- coverage-reporter/send_report | ||
version: 2.1 |