Make library compatible with PHPStan 2.x #61
Workflow file for this run
This file contains 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: Test | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
local-phpstant-1x: | |
name: Local PHPStan 1.x (${{ matrix.php-version }}) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # for checkout to fetch code | |
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: [8.1, 8.2, 8.3, 8.4] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Install dependencies | |
run: composer update --prefer-lowest --no-progress | |
- name: Run PHPStan | |
continue-on-error: true | |
run: vendor/bin/phpstan analyze --configuration=tests/phpstan.neon --error-format=sarif --xdebug "tests/" > local-results.sarif | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: local-v1-${{ matrix.php-version }} | |
path: local-results.sarif | |
- name: Upload analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: local-results.sarif | |
wait-for-processing: true | |
local-phpstant-2x: | |
name: Local PHPStan 2.x (${{ matrix.php-version }}) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # for checkout to fetch code | |
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: [8.1, 8.2, 8.3, 8.4] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Install dependencies | |
run: composer update --prefer-dist --no-progress | |
- name: Run PHPStan | |
continue-on-error: true | |
run: vendor/bin/phpstan analyze --configuration=tests/phpstan.neon --error-format=sarif --xdebug "tests/" > local-results.sarif | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: local-v2-${{ matrix.php-version }} | |
path: local-results.sarif | |
- name: Upload analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: local-results.sarif | |
wait-for-processing: true | |
package: | |
name: Package ${{ matrix.version }} (${{ matrix.php-version }}) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # for checkout to fetch code | |
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: [8.1, 8.2, 8.3, 8.4] | |
version: ['dev-master', 1.0, 1.1] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- run: rm composer.* | |
- name: Install PHPStan SARIF Formatter | |
run: composer require --dev --prefer-dist --no-progress phpstan/phpstan jbelien/phpstan-sarif-formatter:${{ matrix.version }} | |
- name: Run PHPStan | |
continue-on-error: true | |
run: vendor/bin/phpstan analyze --configuration=tests/phpstan.neon --error-format=sarif --xdebug "tests/" > package-results.sarif | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: package-${{ matrix.version }}-${{ matrix.php-version }} | |
path: package-results.sarif | |
- name: Upload analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: package-results.sarif | |
wait-for-processing: true |