fix: remove lowest dependency testing entirely #4
Workflow file for this run
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: [ main, 'feature/v3.0.0', 'feature/**' ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| php_version: | |
| description: 'PHP version to test (optional, tests all if empty)' | |
| required: false | |
| default: '' | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] | |
| dependencies: ['stable'] | |
| include: [] | |
| # Lowest dependency testing removed due to compatibility issues | |
| # with old package versions on modern PHP releases | |
| continue-on-error: ${{ matrix.php-version == '8.5' }} | |
| name: Tests - PHP ${{ matrix.php-version }} (${{ matrix.dependencies }}) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: dom, curl, libxml, mbstring, zip, json | |
| coverage: xdebug | |
| tools: composer:v2 | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache | |
| key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}- | |
| - name: Install dependencies (lowest) | |
| if: matrix.dependencies == 'lowest' | |
| run: composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction | |
| - name: Install dependencies (stable) | |
| if: matrix.dependencies == 'stable' | |
| run: composer update --prefer-stable --prefer-dist --no-interaction | |
| - name: Validate composer.json | |
| run: composer validate --strict --no-check-lock | |
| - name: Run PHPUnit tests | |
| run: composer test | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| name: Code Quality | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: dom, curl, libxml, mbstring, zip, json | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache | |
| key: ${{ runner.os }}-php-8.4-stable-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-8.4-stable- | |
| - name: Install dependencies | |
| run: composer update --prefer-stable --prefer-dist --no-interaction | |
| - name: Run PHPStan static analysis | |
| run: composer analyse | |
| continue-on-error: true | |
| - name: Run PHP CodeSniffer check | |
| run: composer cs | |
| continue-on-error: true | |
| coverage: | |
| runs-on: ubuntu-latest | |
| name: Coverage Report | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: dom, curl, libxml, mbstring, zip, json | |
| coverage: xdebug | |
| tools: composer:v2 | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache | |
| key: ${{ runner.os }}-php-8.4-coverage-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-8.4-coverage- | |
| - name: Install dependencies | |
| run: composer update --prefer-stable --prefer-dist --no-interaction | |
| - name: Generate coverage report | |
| run: vendor/bin/phpunit --coverage-clover coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |