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)
Note: It’s not necessary to check Encrypt content
- Update Build Settings
see text to copy below screenshots
- Update After job Settings
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 almost 6 years ago