Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support submit from Appveyor #124

Closed
omus opened this issue Apr 5, 2017 · 3 comments
Closed

Support submit from Appveyor #124

omus opened this issue Apr 5, 2017 · 3 comments

Comments

@omus
Copy link
Contributor

omus commented Apr 5, 2017

The Codecov submit function only works from within Travis CI. I found the note below while getting the Repository Upload Token on Codecov:

Note: Token not required for public repositories uploading from Travis, CircleCI or AppVeyor.

From this comment and from inspecting the codecov-bash source it should definitely be possible to support Appveyor. The relevant Appveyor environmental variables can be found here

@omus
Copy link
Contributor Author

omus commented Apr 5, 2017

I tried to make a work around with adding this to my appveyor.yml:

after_test:
  - C:\projects\julia\bin\julia -e "cd(Pkg.dir(\"PKG\")); Pkg.add(\"Coverage\"); using Coverage;
      Codecov.submit(process_folder(),
        service=\"appveyor\",
        branch=ENV[\"APPVEYOR_REPO_BRANCH\"],
        commit=ENV[\"APPVEYOR_REPO_COMMIT\"],
        pull_request=get(ENV, \"APPVEYOR_PULL_REQUEST_NUMBER\", \"\"),
        job=join([ENV[\"APPVEYOR_ACCOUNT_NAME\"], ENV[\"APPVEYOR_PROJECT_SLUG\"], ENV[\"APPVEYOR_BUILD_VERSION\"]], \"%2F\"),
        slug=ENV[\"APPVEYOR_REPO_NAME\"],
        build=ENV[\"APPVEYOR_JOB_ID\"],
      )"

Unfortunately this doesn't work and crashes when trying to evaluate ENV["TRAVIS_BRANCH"]

ERROR: KeyError: TRAVIS_BRANCH not found

@omus
Copy link
Contributor Author

omus commented Apr 5, 2017

Trying to use submit_generic as an additional work around.

@omus
Copy link
Contributor Author

omus commented Apr 5, 2017

I got the following to submit coverage information on Julia 0.4 (newer Julia versions have an issue):

after_test:
  - C:\projects\julia\bin\julia -e "cd(Pkg.dir(\"PKG\")); Pkg.add(\"Coverage\"); Pkg.add(\"URIParser\"); using Coverage, URIParser;
      Codecov.submit_generic(process_folder(),
        service=\"appveyor\",
        branch=ENV[\"APPVEYOR_REPO_BRANCH\"],
        commit=ENV[\"APPVEYOR_REPO_COMMIT\"],
        pull_request=get(ENV, \"APPVEYOR_PULL_REQUEST_NUMBER\", \"\"),
        job=escape(join([ENV[\"APPVEYOR_ACCOUNT_NAME\"], ENV[\"APPVEYOR_PROJECT_SLUG\"], ENV[\"APPVEYOR_BUILD_VERSION\"]], '/')),
        slug=ENV[\"APPVEYOR_REPO_NAME\"],
        build=escape(ENV[\"APPVEYOR_JOB_ID\"]),
      )"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant