experimental updates for rollup #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHPUnit Test Coverage | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
# https://github.com/marketplace/actions/checkout | |
- uses: actions/checkout@v3 | |
- 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 | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Run test suite | |
env: | |
XDEBUG_MODE: coverage | |
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.3' | |
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@v3 | |
with: | |
fail_ci_if_error: false | |
files: ./coverage.xml | |
verbose: true | |
# 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.2.0 | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
debug: true | |
coverageLocations: | | |
coverage.xml:clover |