collectiveidea / interactor

Interactor provides a common interface for performing complex user interactions.
MIT License
3.36k stars 212 forks source link

Travis: CodeClimate usage with after_success #142

Closed olleolleolle closed 7 years ago

olleolleolle commented 7 years ago

This PR adds the after_success hook to Travis builds, to use the supported way of using CodeClimate.

Read more at https://docs.codeclimate.com/v1.0/docs/travis-ci-ruby-test-coverage.

~Issue: Cannot post results: environment variable CODECLIMATE_REPO_TOKEN must be set. Is there a problem with the secure ENV var, somehow?~

Update: Only send coverage information to CodeClimate if not on a PR.

olleolleolle commented 7 years ago

There is a note in this page: https://docs.codeclimate.com/v1.0/docs/travis-ci-ruby-test-coverage

addons:
  code_climate:
    repo_token: <token>
# regular test configuration
after_success:
  - bundle exec codeclimate-test-reporter

Somehow, the encrypted ENV var does not get there.

laserlemon commented 7 years ago

See: https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions

olleolleolle commented 7 years ago

@laserlemon Thanks for a great link.

laserlemon commented 7 years ago

@olleolleolle I'm going to take your primary commit and move it to a new PR so we can properly test the implementation. It sounds like a PR for a branch on the same repo will properly set secure ENV variables. Stand by! And thank you! 👏

olleolleolle commented 7 years ago

@laserlemon Now were down to "start simplecov, avoid calling CodeClimate if not on a real branch".

laserlemon commented 7 years ago

@olleolleolle Closing in favor of #143. I don't mind if we always try to send stats to CodeClimate. If we're not on a repo-owned branch that will expose the secure ENV variable, it'll just skip that step quietly anyway.