Stop suggesting phpunit prepend #20
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: quality | |
on: | |
pull_request: | |
types: [opened, reopened, edited, synchronize] | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
name: PHP ${{ matrix.php-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] | |
steps: | |
# Set up the correct PHP version | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
coverage: xdebug | |
# Restore the composer cache folders to speed up the composer update | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
# Check out the code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Composer install | |
- name: Run composer update | |
run: composer update | |
# Run unit tests with code coverage | |
- name: Run phpunit | |
run: vendor/bin/phpunit --coverage-clover=coverage/coverage.xml || vendor/bin/phpunit --migrate-configuration --coverage-clover=coverage/coverage.xml | |
# Upload the code coverage artifact | |
- name: Upload code coverage artifact | |
if: ${{ matrix.php-version == '7.2' }} | |
uses: actions/upload-artifact@v1 | |
with: | |
name: coverage | |
path: coverage/coverage.xml | |
standards: | |
name: standards | |
runs-on: ubuntu-latest | |
steps: | |
# Setup the correct PHP version | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.2' | |
# Restore the composer cache folders to speed up the composer update | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-7.2-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
# Check out the code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Composer install | |
- name: Composer update | |
run: composer update | |
# Run the code sniffer | |
- name: Code sniffer | |
if: always() | |
run: vendor/bin/php-cs-fixer fix --dry-run --diff | |
# Run the static analysis | |
- name: Static analysis | |
if: always() | |
run: vendor/bin/phan | |
coverage: | |
name: Publish code coverage | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
# Check out the code | |
- uses: actions/checkout@v2 | |
# Download the coverage artifact | |
- name: Download code coverage artifact | |
uses: actions/download-artifact@v1 | |
with: | |
name: coverage | |
# Upload coverage artifact | |
- name: Upload code coverage | |
run: bash <(curl -s https://codecov.io/bash) -Z -t ${{ secrets.CODECOV_TOKEN }} -f coverage/coverage.xml |