Skip to content

Commit

Permalink
update test coverage action
Browse files Browse the repository at this point in the history
  • Loading branch information
joemaller committed Feb 29, 2024
1 parent 67ff181 commit a33f92a
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/phpunit-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ on:
branches: [master]

jobs:
build:
runs-on: ubuntu-20.04
test:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4

- name: Global install PHPUnit & update $PATH
run: |
composer global require phpunit/phpunit --prefer-dist
echo "$HOME/.composer/vendor/bin" >> $GITHUB_PATH
- name: Validate composer.json and composer.lock
run: composer validate
Expand All @@ -22,22 +28,24 @@ jobs:
- name: Run test suite
env:
XDEBUG_MODE: coverage
run: vendor/bin/phpunit
run: phpunit

# The Coveralls repo token is found on the project's Settings page
# https://github.com/php-coveralls/php-coveralls
- name: Upload to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_RUN_LOCALLY: yes
run: |
composer require 'php-coveralls/php-coveralls:2.5.2'
composer require 'php-coveralls/php-coveralls:2.7.0'
vendor/bin/php-coveralls \
--coverage_clover ./coverage.xml \
--json_path ./coveralls-upload.json \
--verbose
# https://github.com/codecov/codecov-action
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
files: ./coverage.xml
Expand All @@ -46,8 +54,9 @@ jobs:
# The Code Climate Test Coverage Reporter ID can be found by visiting the project's
# Repo Settings pane, click Test Coverage in the left sidebar. Find the ID in the
# second section.
# https://github.com/paambaati/codeclimate-action
- name: Code Climate coverage
uses: paambaati/codeclimate-action@v3.0.0
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
Expand Down

0 comments on commit a33f92a

Please sign in to comment.