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

Add support for Github actions #273

Closed
ADmad opened this issue Sep 19, 2019 · 14 comments
Closed

Add support for Github actions #273

ADmad opened this issue Sep 19, 2019 · 14 comments

Comments

@ADmad
Copy link

ADmad commented Sep 19, 2019

Currently php-coveralls doesn't auto detect which service it's running on when using Github Actions. It would be nice if it could do so.

Even better if there was a .yml config available for Github action for uploading data to coveralls using this tool.

@ADmad
Copy link
Author

ADmad commented Sep 19, 2019

There's an official github action repo by coveralls but it seems to be for js based projects only https://github.com/coverallsapp/github-action.

@renekorss
Copy link

renekorss commented Oct 2, 2019

You can use it as it is in local environment since Github has support for secrets.

Your step would look something like this:

- name: Send to coveralls
  run: php vendor/bin/php-coveralls -v
  env:
    COVERALLS_RUN_LOCALLY: 1
    COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

And create secret with repo token which you can get from coveralls repo settings.

See it in action on my repo.

@Smolevich
Copy link
Contributor

Smolevich commented Oct 21, 2019

You can use it as it is in local environment since Github has support for secrets.

Your step would look something like this:

- name: Send to coveralls
  run: php vendor/bin/php-coveralls -v
  env:
    COVERALLS_RUN_LOCALLY: 1
    COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

And create secret with repo token which you can get from coveralls repo settings.

See it in action on my repo.

What about branch names in coveralls.io? I mean that i test php-coveralls, branch for master showed as in attachment
Снимок экрана 2019-10-21 в 10 42 13

@renekorss
Copy link

Yes, I'm seeing same result. Don't know currently how to fix this.

@Smolevich
Copy link
Contributor

If use this library need to add new method for collecting env variables from Github Actions here

@renekorss
Copy link

If use this library need to add new method for collecting env variables from Github Actions here

Yes, correct. I will take a look if I can find time to create PR for this.

@Smolevich
Copy link
Contributor

Smolevich commented Oct 21, 2019

@renekoss, i prepare PR #275

SignpostMarv added a commit to SignpostMarv/steam-id that referenced this issue Jan 3, 2020
@Smolevich
Copy link
Contributor

@keradus can we change status of PR linked with this issue in this month?

@tarlepp
Copy link

tarlepp commented Jan 29, 2020

Any updates about this issue?

@peter279k
Copy link
Contributor

You can use it as it is in local environment since Github has support for secrets.

Your step would look something like this:

- name: Send to coveralls
  run: php vendor/bin/php-coveralls -v
  env:
    COVERALLS_RUN_LOCALLY: 1
    COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

And create secret with repo token which you can get from coveralls repo settings.

See it in action on my repo.

I also have this issue, and I use this approach @renekorss that mentions for my repository.

And it's worked for me :).

@twinh
Copy link
Contributor

twinh commented Jun 14, 2020

Hello, I have merged the PR into my forked repo, added parallel job support, and published a new release, feel free to use it.

https://github.com/twinh/php-coveralls#github-actions

Add a new step after phpunit generate coverage report.

- name: Upload coverage results to Coveralls
  env:
    COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    composer global require twinh/php-coveralls
    php-coveralls --coverage_clover=build/logs/clover.xml -v

@keradus
Copy link
Member

keradus commented Sep 24, 2020

would you mind to help finalizing #275 , @twinh ?

@twinh
Copy link
Contributor

twinh commented Sep 28, 2020

@keradus yeah, I have created a new pull request #296, please review it, thanks!

@keradus
Copy link
Member

keradus commented Oct 5, 2020

Closing due to merge of #296 (to be released tonight)

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

7 participants