Fix Version #442
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: build | |
| on: | |
| push: ~ | |
| pull_request: ~ | |
| jobs: | |
| tests: | |
| name: Tests • PHP ${{ matrix.php }} • ${{ matrix.stability }} | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| php: ['8.1', '8.2', '8.3', '8.4', '8.5'] | |
| stability: [prefer-lowest, prefer-stable] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: xdebug | |
| tools: composer:v2 | |
| - name: Validate composer files | |
| run: composer validate --strict | |
| # ----------------------- | |
| # Composer cache | |
| # ----------------------- | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache Composer Files | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-php${{ matrix.php }}-${{ matrix.stability }}-composer-${{ hashFiles('composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php${{ matrix.php }}-${{ matrix.stability }}-composer- | |
| ${{ runner.os }}-php${{ matrix.php }}-composer- | |
| ${{ runner.os }}-composer- | |
| # ----------------------- | |
| # vendor/ cache | |
| # ----------------------- | |
| - name: Cache vendor directory | |
| id: vendor-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: vendor-${{ runner.os }}-php${{ matrix.php }}-${{ matrix.stability }}-${{ hashFiles('composer.lock') }} | |
| - name: Install dependencies | |
| if: steps.vendor-cache.outputs.cache-hit != 'true' | |
| run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress | |
| # ----------------------- | |
| # PHPUnit coverage cache | |
| # ----------------------- | |
| - name: Cache PHPUnit coverage | |
| uses: actions/cache@v3 | |
| with: | |
| path: build/coverage | |
| key: coverage-${{ runner.os }}-php${{ matrix.php }}-${{ github.sha }} | |
| - name: Run Unit tests | |
| run: composer phpunit | |
| # ----------------------------------------------------------- | |
| static_analysis: | |
| name: Static Analysis (PHP 8.4, prefer-stable) | |
| runs-on: ubuntu-22.04 | |
| needs: tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP 8.4 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| tools: composer:v2 | |
| # Restore vendor cache | |
| - name: Restore vendor cache | |
| id: vendor-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: vendor-${{ runner.os }}-php8.4-prefer-stable-${{ hashFiles('composer.lock') }} | |
| - name: Install dependencies if needed | |
| run: composer update --prefer-stable --no-interaction --no-progress | |
| if: steps.vendor-cache.outputs.cache-hit != 'true' | |
| - name: Run PHPStan | |
| run: composer phpstan | |
| # ----------------------------------------------------------- | |
| coding_style: | |
| name: Coding Style (PHP 8.4, prefer-stable) | |
| runs-on: ubuntu-22.04 | |
| needs: tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP 8.4 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| tools: composer:v2 | |
| # Restore vendor cache | |
| - name: Restore vendor cache | |
| id: vendor-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: vendor-${{ runner.os }}-php8.4-prefer-stable-${{ hashFiles('composer.lock') }} | |
| - name: Install dependencies if needed | |
| run: composer update --prefer-stable --no-interaction --no-progress | |
| if: steps.vendor-cache.outputs.cache-hit != 'true' | |
| - name: Run PHPCS | |
| run: composer phpcs:fix |