Skip to content

Add PHP 7.x Support #54

Add PHP 7.x Support

Add PHP 7.x Support #54

Workflow file for this run

name: Test
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
permissions:
contents: read
jobs:
local:
name: Local (${{ 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: ["7.4", "8.1", "8.2"]
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 install --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-${{ 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: ["7.4", "8.1", "8.2"]
version: ["dev-master", "1.0"]
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