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 github actions CI #207

Merged
merged 1 commit into from Dec 3, 2019
Merged

Conversation

ArturKlauser
Copy link
Contributor

This adds support for CI running on github actions.

Getting the branch name is a little more tricky since the default way of repository cloning with actions/checkout puts you in a detached HEAD in which the regular git rev-parse --abbrev-ref HEAD returns HEAD instead of the branch name.

Copy link
Owner

@TheKevJames TheKevJames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changeset looks good, thanks for the contribution! I'll set up Github Actions on this repo for testing and, assuming all goes well, release this in the next version bump.

@TheKevJames TheKevJames merged commit 817119c into TheKevJames:master Dec 3, 2019
ArturKlauser added a commit to ArturKlauser/coveralls-python that referenced this pull request Dec 3, 2019
@ArturKlauser
Copy link
Contributor Author

Seems like this is running into the weirdest issue with the coveralls API. The new coveralls-python 1.9.x works all peachy under Github Actions until it comes to the point of submitting the data to coveralls.io. Its API seems to steadfastly refuse a service name of github. It appears to accept pretty much anything else. It's totally weird.

coveralls-python$ GITHUB_ACTIONS=true GITHUB_REF=refs/heads/master GITHUB_HEAD_REF='' COVERALLS_REPO_TOKEN=mytoken \
coveralls --service github
Submitting coverage to coveralls.io...
Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/coveralls/api.py", line 185, in wear
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/coveralls/cli.py", line 77, in main
    result = coverallz.wear()
  File "/usr/local/lib/python3.7/site-packages/coveralls/api.py", line 188, in wear
    raise CoverallsException('Could not submit coverage: {}'.format(e))
coveralls.exception.CoverallsException: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs

coveralls-python$ GITHUB_ACTIONS=true GITHUB_REF=refs/heads/master GITHUB_HEAD_REF='' COVERALLS_REPO_TOKEN=mytoken \
coveralls --service github-ci
Submitting coverage to coveralls.io...
Coverage submitted!
Job ##19.1
https://coveralls.io/jobs/56404049

When you compare coveralls dump it's identical apart from the service name. I also tried service names of github-actions, github-actions-ci, anything. They all work, just service name github is rejected by the coveralls API server.

I suggest we rename the service to github-actions. I'll send you another pull request with that later.

@TheKevJames
Copy link
Owner

Well that's... odd. Alrighty, github-actions makes sense to me.

@ArturKlauser ArturKlauser deleted the github-ci branch December 3, 2019 20:27
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

Successfully merging this pull request may close these issues.

None yet

2 participants