Semaphore CI Test Coverage
Examples
For more example scripts, head to the test reporter repo on GitHub.
- Add
CC_TEST_REPORTER_ID
to the Environment Variables (Project Settings -> Environment Variables)
![Copy_of_Test_Reporter_Setup_on_Semaphore_CI_-_Google_Docs.png 616](https://files.readme.io/078e595-Copy_of_Test_Reporter_Setup_on_Semaphore_CI_-_Google_Docs.png)
Note: Itβs not necessary to check Encrypt content
- Update Build Settings
see text to copy below screenshots
![semaphore2.png 616](https://files.readme.io/d699dd8-semaphore2.png)
- Update After job Settings
![semaphore3.png 613](https://files.readme.io/51636b3-semaphore3.png)
Commands from this comment and this comment
# setup 1
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
# setup 2
chmod +x ./cc-test-reporter
# setup 4
./cc-test-reporter before-build
# After job
exitcode=$(if [ "$SEMAPHORE_THREAD_RESULT" == "passed" ]; then echo 0; else echo 1; fi)
./cc-test-reporter after-build --exit-code $exitcode
Troubleshooting
Error: could not find any viable formatter. available formatters: simplecov, lcov, coverage.py, clover, gocov, gcov, cobertura, jacoco
- confirm that you're using one of the coverage tools listed in this table
Updated over 5 years ago