Skip to content

Commit

Permalink
Merge pull request #354 from Yoast/JRF/ghactions-switch-to-coveralls-…
Browse files Browse the repository at this point in the history
…reporter

GH Actions: switch to Coveralls action runner to upload reports
  • Loading branch information
jrfnl authored Nov 24, 2023
2 parents e988745 + 127cac3 commit 07a91b8
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,26 +220,14 @@ jobs:
- name: Run the unit tests with code coverage
run: composer coverage

# Uploading the results with PHP Coveralls v1 won't work from GH Actions, so switch the PHP version.
- name: Switch to PHP 7.4
if: ${{ success() && matrix.php_version != '7.4' }}
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none

# Global install is used to prevent a conflict with the local composer.lock in PHP 8.0+.
- name: Install Coveralls
if: ${{ success() }}
run: composer global require php-coveralls/php-coveralls:"^2.5.3" --no-interaction

- name: Upload coverage results to Coveralls
if: ${{ success() }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: php-${{ matrix.php_version }}-cs-${{ matrix.cs_dependencies }}
run: php-coveralls -v -x build/logs/clover.xml
uses: coverallsapp/github-action@v2
with:
format: clover
file: build/logs/clover.xml
flag-name: php-${{ matrix.php_version }}-cs-${{ matrix.cs_dependencies }}
parallel: true

coveralls-finish:
needs: coverage
Expand All @@ -251,5 +239,4 @@ jobs:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_TOKEN }}
parallel-finished: true

0 comments on commit 07a91b8

Please sign in to comment.