11version : 2.1
22
33orbs :
4- codacy : codacy/base@9.3.5
4+ codacy : codacy/base@10.1.1
55
66references :
77 circleci_job : &circleci_job
@@ -207,25 +207,45 @@ workflows:
207207 requires :
208208 - codacy/checkout_and_version
209209 - codacy/sbt :
210- name : scalafmt_and_compile
211- cmd : sbt "scalafmtCheckAll;scalafmtSbtCheck;test:compile;it:compile"
210+ name : compile_and_test
212211 persist_to_workspace : true
212+ steps_before_sbt :
213+ - run :
214+ name : Enable coverage
215+ command : echo "ThisBuild / coverageEnabled := true" > coverage.sbt
216+ steps :
217+ - run :
218+ name : Check formatting Sbt files
219+ command : sbt scalafmtSbtCheck
220+ - run :
221+ name : Check formatting Scala files
222+ command : sbt scalafmtCheckAll
223+ - run :
224+ name : Test compile
225+ command : sbt test:compile
226+ - run :
227+ name : It compile
228+ command : sbt it:compile
229+ - run :
230+ name : Unit testing
231+ command : sbt test
232+ - run :
233+ name : It testing
234+ command : sbt it:test
235+ - run :
236+ name : Aggregate coverage reports
237+ command : sbt coverageAggregate
238+ - run :
239+ name : Send coverage report to Codacy
240+ # Specify only scala coverage reports, because coverage reporter is detecting coverage reports
241+ # for other languages that are not valid and are used on tests
242+ command : |
243+ bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Scala -r "**/cobertura*.xml"
244+ - run :
245+ name : Clean coverage.sbt from cache
246+ command : rm coverage.sbt
213247 requires :
214248 - codacy/checkout_and_version
215- - codacy/sbt :
216- name : test_and_coverage
217- cmd : |
218- sbt coverage test
219- sbt coverageAggregate
220- ./get.sh report --skip
221- requires :
222- - scalafmt_and_compile
223- - codacy/sbt :
224- name : integration_tests
225- cmd : sbt it:test
226- persist_to_workspace : true
227- requires :
228- - scalafmt_and_compile
229249 - codacy/sbt :
230250 name : create_artifacts
231251 cmd : |
@@ -236,7 +256,7 @@ workflows:
236256 mv target/codacy-coverage-reporter-assembly-$(cat .version).jar ~/workdir/tmp-artifacts/codacy-coverage-reporter-assembly.jar
237257 persist_to_workspace : true
238258 requires :
239- - scalafmt_and_compile
259+ - compile_and_test
240260 - codacy/sbt_osx :
241261 name : create_artifacts_for_osx
242262 cmd : |
@@ -258,7 +278,7 @@ workflows:
258278 persist_to_workspace : true
259279 persist_to_workspace_path : " tmp-artifacts/codacy-coverage-reporter-darwin"
260280 requires :
261- - scalafmt_and_compile
281+ - compile_and_test
262282 - package_artifacts :
263283 requires :
264284 - create_artifacts
0 commit comments