Update README and ExecutionTimeReportPrinter for improved test output… #9
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ master, main, develop ] | |
| pull_request: | |
| branches: [ master, main, develop ] | |
| jobs: | |
| test: | |
| name: PHP ${{ matrix.php }} with PHPUnit ${{ matrix.phpunit }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.1', '8.2', '8.3', '8.4'] | |
| phpunit: ['^10.0', '^11.0', '^12.0'] | |
| exclude: | |
| # PHPUnit 12 requires PHP 8.3+ | |
| - php: '8.1' | |
| phpunit: '^12.0' | |
| - php: '8.2' | |
| phpunit: '^12.0' | |
| # PHPUnit 11 requires PHP 8.2+ | |
| - php: '8.1' | |
| phpunit: '^11.0' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring, xml | |
| coverage: none | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| shell: bash | |
| run: | | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: | | |
| composer require --dev phpunit/phpunit:"${{ matrix.phpunit }}" --no-interaction --prefer-dist | |
| composer install --no-interaction --prefer-dist | |
| - name: Run PHPUnit | |
| run: composer test | |
| code-quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: mbstring, xml | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| shell: bash | |
| run: | | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Run PHPStan | |
| run: composer analyse | |
| - name: Run PHPCS | |
| run: composer cs-check |