Skip to content

Lint workflows

Lint workflows #507

# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Test Slevomat Coding Standard"
on:
pull_request:
push:
branches:
- "2.3.x"
permissions:
contents: read
jobs:
tests:
name: "Tests"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: "Checkout Slevomat Coding Standard"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: slevomat/coding-standard
path: slevomat-cs
ref: ae7325d76167f02e3b20b0ad19122dcf472188e4
- name: "Install PHP"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: "Unset platform"
working-directory: slevomat-cs
run: "composer config --unset platform"
- name: "Install dependencies"
working-directory: slevomat-cs
run: "composer install --no-interaction --no-progress"
- name: "Remove stable phpdoc-parser"
working-directory: slevomat-cs
run: "rm -r vendor/phpstan/phpdoc-parser/src"
- name: "Remove top-level phpcs.xml"
run: "rm phpcs.xml"
- name: "Copy phpdoc-parser"
run: "cp -r src/ slevomat-cs/vendor/phpstan/phpdoc-parser/src"
- name: "Tests"
working-directory: slevomat-cs
run: "bin/phpunit --no-coverage"
- name: "PHPStan"
if: matrix.php-version == '8.5'
working-directory: slevomat-cs
run: "bin/phpstan analyse -c build/PHPStan/phpstan.neon"
- name: "PHPStan in tests"
if: matrix.php-version == '8.5'
working-directory: slevomat-cs
run: "bin/phpstan analyse -c build/PHPStan/phpstan.tests.neon"