Skip to content

Commit 5bda2df

Browse files
authored
Merge pull request #289 from PHPCSStandards/feature/ghactions-switch-to-coveralls-reporter
GH Actions: switch to Coveralls action runner to upload reports
2 parents 8cc8d88 + 2e6001d commit 5bda2df

File tree

1 file changed

+8
-43
lines changed

1 file changed

+8
-43
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -168,37 +168,14 @@ jobs:
168168
- name: Run the unit tests with code coverage
169169
run: composer coverage
170170

171-
# PHP Coveralls v2 (which supports GH Actions) has a PHP 5.5 minimum, so switch the PHP version.
172-
- name: Switch to PHP latest
173-
if: ${{ success() && matrix.php == '5.4' }}
174-
uses: shivammathur/setup-php@v2
175-
with:
176-
php-version: 'latest'
177-
coverage: none
178-
179-
# Global install is used to prevent a conflict with the local composer.lock.
180-
- name: Install Coveralls
171+
- name: Upload coverage results to Coveralls
181172
if: ${{ success() }}
182-
run: composer global require php-coveralls/php-coveralls:"^2.6.0" --no-interaction
183-
184-
- name: Upload coverage results to Coveralls (normal)
185-
if: ${{ success() && github.actor != 'dependabot[bot]' }}
186-
env:
187-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
188-
COVERALLS_PARALLEL: true
189-
COVERALLS_FLAG_NAME: php-${{ matrix.php }}-phpcs-${{ matrix.phpcs_version }}
190-
run: php-coveralls -v -x build/logs/clover.xml
191-
192-
# Dependabot does not have access to secrets, other than the GH token.
193-
# Ref: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
194-
# Ref: https://github.com/lemurheavy/coveralls-public/issues/1721
195-
- name: Upload coverage results to Coveralls (Dependabot)
196-
if: ${{ success() && github.actor == 'dependabot[bot]' }}
197-
env:
198-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
199-
COVERALLS_PARALLEL: true
200-
COVERALLS_FLAG_NAME: php-${{ matrix.php }}-phpcs-${{ matrix.phpcs_version }}
201-
run: php-coveralls -v -x build/logs/clover.xml
173+
uses: coverallsapp/github-action@v2
174+
with:
175+
format: clover
176+
file: build/logs/clover.xml
177+
flag-name: php-${{ matrix.php }}-phpcs-${{ matrix.phpcs_version }}
178+
parallel: true
202179

203180
coveralls-finish:
204181
needs: coverage
@@ -207,19 +184,7 @@ jobs:
207184
runs-on: ubuntu-latest
208185

209186
steps:
210-
- name: Coveralls Finished (normal)
211-
if: ${{ github.actor != 'dependabot[bot]' }}
212-
uses: coverallsapp/github-action@v2
213-
with:
214-
github-token: ${{ secrets.COVERALLS_TOKEN }}
215-
parallel-finished: true
216-
217-
# Dependabot does not have access to secrets, other than the GH token.
218-
# Ref: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
219-
# Ref: https://github.com/lemurheavy/coveralls-public/issues/1721
220-
- name: Coveralls Finished (Dependabot)
221-
if: ${{ github.actor == 'dependabot[bot]' }}
187+
- name: Coveralls Finished
222188
uses: coverallsapp/github-action@v2
223189
with:
224-
github-token: ${{ secrets.GITHUB_TOKEN }}
225190
parallel-finished: true

0 commit comments

Comments
 (0)