Updates CI workflow with PHP versions and tools #34
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| tests: | |
| name: Tests (PHP ${{ matrix.php }}, ${{ matrix.dependency }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [8.4] | |
| dependency: [prefer-lowest, prefer-stable] | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring, intl, pcre, tokenizer, xml | |
| - name: Install Dependencies (${{ matrix.dependency }}) | |
| run: | | |
| composer update --${{ matrix.dependency }} --prefer-dist --no-interaction | |
| - name: Run Unit Tests | |
| run: ./vendor/bin/phpunit tests/Unit/ --colors=always | |
| - name: Run Integration Tests | |
| run: ./vendor/bin/phpunit tests/Integration/ --colors=always | |
| phpstan: | |
| name: PHPStan (PHP ${{ matrix.php }}, ${{ matrix.dependency }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.4', '8.5'] | |
| dependency: [prefer-lowest, prefer-stable] | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring, intl, pcre, tokenizer, xml | |
| - name: Install Dependencies (${{ matrix.dependency }}) | |
| run: | | |
| composer update --${{ matrix.dependency }} --prefer-dist --no-interaction | |
| - name: Install PHPStan Tooling | |
| run: composer install -d tools/phpstan --no-interaction --no-progress | |
| - name: Run PHPStan | |
| run: ./bin/phpstan analyse | |
| phpcs: | |
| name: PHPCS | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP 8.4 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php: '8.4' | |
| extensions: mbstring, intl, pcre, tokenizer, xml | |
| - name: Install Dependencies | |
| run: composer install --no-interaction --no-progress --prefer-dist | |
| - name: Install PHP-CS-Fixer Tooling | |
| run: composer install -d tools/php-cs-fixer --no-interaction --no-progress | |
| - name: Run PHP-CS-Fixer | |
| run: ./bin/php-cs-fixer fix --dry-run --diff | |
| rector: | |
| name: Rector | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP 8.4 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php: '8.4' | |
| extensions: mbstring, intl, pcre, tokenizer, xml | |
| - name: Install Dependencies | |
| run: composer install --no-interaction --no-progress --prefer-dist | |
| - name: Install Rector Tooling | |
| run: composer install -d tools/rector --no-interaction --no-progress | |
| - name: Run Rector | |
| run: ./bin/rector process --dry-run --ansi | |
| phplint: | |
| name: PHPLint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP 8.4 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: mbstring, intl, pcre, tokenizer, xml | |
| - name: Install Dependencies | |
| run: composer install --no-interaction --no-progress --prefer-dist | |
| - name: Install PHPLint Tooling | |
| run: composer install -d tools/phplint --no-interaction --no-progress | |
| - name: Run PHPLint | |
| run: ./bin/phplint | |
| validation: | |
| name: Validation & Feature Completeness | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP 8.4 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: mbstring, intl, pcre, tokenizer, xml | |
| - name: Install Dependencies | |
| run: composer install --no-interaction --no-progress --prefer-dist | |
| - name: Run Library Validation | |
| run: php tests/validate_library.php | |
| - name: Run PCRE Feature Completeness Tests | |
| run: ./vendor/bin/phpunit tests/Integration/PcreFeatureCompletenessTest.php --testdox | |
| - name: Run ReDoS Detection Tests | |
| run: ./vendor/bin/phpunit tests/Integration/ReDoSEdgeCasesTest.php --testdox |