coverage.sh 626 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. set -o errexit -o pipefail
  3. # Executes cleanup function at script exit.
  4. trap cleanup EXIT
  5. cleanup() {
  6. # Delete the symlink created to the allFiredEvents file solidity-coverage creates
  7. rm -f allFiredEvents
  8. }
  9. log() {
  10. echo "$*" >&2
  11. }
  12. # The allFiredEvents file is created inside coverageEnv, but solidity-coverage
  13. # expects it to be at the top level. We create a symlink to fix this
  14. ln -s coverageEnv/allFiredEvents allFiredEvents
  15. OZ_TEST_ENV_COVERAGE=true npx solidity-coverage || log "Test run failed"
  16. if [ "$CI" = true ]; then
  17. curl -s https://codecov.io/bash | bash -s -- -C "$CIRCLE_SHA1"
  18. fi