Merge pull request #5 from phpcq/feature/php-8-only #23
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: Code Quality Diagnostics | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
| - 'release/**' | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| name: PHP ${{ matrix.php }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - php: '8.1' | ||
| phpcq_install: 'update' | ||
| phpcq_flags: '' | ||
| - php: '8.2' | ||
| phpcq_install: 'update' | ||
| phpcq_flags: '' | ||
| - php: '8.3' | ||
| phpcq_install: 'update' | ||
| phpcq_flags: '' | ||
| - php: '8.4' | ||
| phpcq_install: 'update' | ||
| phpcq_flags: '' | ||
| - php: '8.5' | ||
| phpcq_install: 'update' | ||
| phpcq_flags: '' | ||
| steps: | ||
| - name: Pull source | ||
| uses: actions/checkout@v4 | ||
| - name: Setup PHP with PECL extension | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| - name: Cache composer cache directory | ||
| uses: actions/cache@v4 | ||
| env: | ||
| cache-name: composer-cache-dir-${{ matrix.php }} | ||
| with: | ||
| path: ~/.cache/composer | ||
| key: ${{ runner.os }}-build-${{ env.cache-name }} | ||
| - name: Cache phpcq directory | ||
| uses: actions/cache@v4 | ||
| env: | ||
| cache-name: phpcq-${{ matrix.php }} | ||
| with: | ||
| path: .phpcq | ||
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-build-${{ env.cache-name }}- | ||
| - name: Cache vendor directory | ||
| uses: actions/cache@v4 | ||
| env: | ||
| cache-name: vendor-${{ matrix.php }} | ||
| with: | ||
| path: vendor | ||
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-build-${{ env.cache-name }}- | ||
| - name: Install composer dependencies | ||
| run: composer install | ||
| - name: Update phpcq | ||
| run: ./vendor/bin/phpcq self-update | ||
| - name: Install phpcq toolchain | ||
| run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v | ||
| - name: Run tests | ||
| run: ./vendor/bin/phpcq run -o github-action -o default ${{ matrix.phpcq_flags }} | ||
| - name: Upload build directory to artifact | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ success() }} || ${{ failure() }} | ||
|
Check warning on line 86 in .github/workflows/diagnostics.yml
|
||
| with: | ||
| name: phpcq-builds-php-${{ matrix.php }} | ||
| path: .phpcq/build/ | ||