Skip to content

composer(deps-dev): update phpstan/phpstan requirement #1928

composer(deps-dev): update phpstan/phpstan requirement

composer(deps-dev): update phpstan/phpstan requirement #1928

# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
# file-version: 1.0
name: "Continuous Integration"
on:
- pull_request
- push
permissions:
contents: read
concurrency:
group: "${{ github.event_name }}-${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
validate:
name: "Validate Project"
uses: "mimmi20/ci/.github/workflows/validate.yml@8.1"
with:
extensions: "ctype, curl, iconv, mbstring, ctype, dom, intl, simplexml, tokenizer, xml, xmlwriter, pdo"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
composer-options: "--optimize-autoloader --prefer-dist --prefer-stable -v"
skip-validate-composer: false
skip-phplint: false
skip-check-composer: true
dependency-analyser-options: "--ignore-unknown-classes"
install:
name: "Install Project"
needs: "validate"
uses: "mimmi20/ci/.github/workflows/install.yml@master"
with:
extensions: "ctype, curl, iconv, mbstring, ctype, dom, intl, simplexml, tokenizer, xml, xmlwriter, pdo"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
composer-options: "--optimize-autoloader --prefer-dist --prefer-stable -v"
skip-php-install: false
skip-npm-install: true
php-cs-fixer:
name: "Check Coding Standards with PHP-CS-Fixer"
needs: "install"
runs-on: "${{ matrix.operating-system }}"
timeout-minutes: 10
continue-on-error: false
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-20.04"
php-version:
# Should use the lowest supported version
- "8.1"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
lfs: false
persist-credentials: false
- name: "Install PHP"
uses: "shivammathur/setup-php@2.30.4"
with:
php-version: "${{ matrix.php-version }}"
extensions: "json, opcache"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
coverage: "none"
tools: "composer:v2, cs2pr"
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
phpts: "nts"
- name: "Update dependencies with composer"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "lowest"
composer-options: "--optimize-autoloader --prefer-dist --prefer-stable -v"
- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --dry-run -vv --diff"
continue-on-error: true
- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr"
phpcs:
name: "Check Coding Standards with PHPCS"
needs: "install"
runs-on: "${{ matrix.operating-system }}"
timeout-minutes: 10
continue-on-error: false
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-20.04"
php-version:
# Should use the lowest supported version
- "8.1"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
lfs: false
persist-credentials: false
- name: "Install PHP"
uses: "shivammathur/setup-php@2.30.4"
with:
php-version: "${{ matrix.php-version }}"
extensions: "json, opcache"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
coverage: "none"
tools: "composer:v2, cs2pr"
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
phpts: "nts"
- name: "Update dependencies with composer"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "lowest"
composer-options: "--optimize-autoloader --prefer-dist --prefer-stable -v"
- name: "Run squizlabs/php_codesniffer"
run: "vendor/bin/phpcs -wps --colors --standard=src/Mimmi20CodingStandard/ruleset.xml --extensions=php,stub -q --report=checkstyle src stubs .php-cs-fixer.php rector.php | cs2pr"
static-code-analysis:
name: "Static Code Analysis with PHPStan"
needs: "install"
runs-on: "${{ matrix.operating-system }}"
timeout-minutes: 10
continue-on-error: false
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-20.04"
php-version:
# Should use the lowest supported version
- "8.1"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
lfs: false
persist-credentials: false
- name: "Install PHP"
uses: "shivammathur/setup-php@2.30.4"
with:
php-version: "${{ matrix.php-version }}"
extensions: "json, opcache"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
coverage: "none"
tools: "composer:v2"
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
phpts: "nts"
- name: "Update dependencies with composer"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "lowest"
composer-options: "${{ inputs.composer-options }}"
- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=768M --no-progress"
phpmd:
name: "Check Rules with PHPMD"
needs: "install"
runs-on: "${{ matrix.operating-system }}"
timeout-minutes: 10
continue-on-error: false
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-20.04"
php-version:
# Should use the lowest supported version
- "8.1"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
lfs: false
persist-credentials: false
- name: "Install PHP"
uses: "shivammathur/setup-php@2.30.4"
with:
php-version: "${{ matrix.php-version }}"
extensions: "json, opcache"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
coverage: "none"
tools: "composer:v2, phpmd"
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
phpts: "nts"
- name: "Update dependencies with composer"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "lowest"
composer-options: "${{ inputs.composer-options }}"
- name: "Run phpmd/phpmd"
run: "phpmd src github phpmd.ruleset.xml"
rector:
name: "Checks with Rector"
needs: "install"
runs-on: "${{ matrix.operating-system }}"
timeout-minutes: 10
continue-on-error: false
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-20.04"
php-version:
# Should use the lowest supported version
- "8.1"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
lfs: false
persist-credentials: false
- name: "Install PHP"
uses: "shivammathur/setup-php@2.30.4"
with:
php-version: "${{ matrix.php-version }}"
extensions: "json, opcache"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
coverage: "none"
tools: "composer:v2, rector"
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
phpts: "nts"
- name: "Update dependencies with composer"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "lowest"
composer-options: "${{ inputs.composer-options }}"
- name: "Run checks with rector/rector"
run: "rector process --ansi --dry-run"
continue-on-error: true
- name: "Run checks with rector/rector"
run: "rector process --ansi --dry-run --no-diffs"
# This is a meta job to avoid to have to constantly change the protection rules
# whenever we touch the matrix.
tests-status:
name: "Validate & Lint Status"
runs-on: "ubuntu-22.04"
if: always()
needs:
- "php-cs-fixer"
- "phpcs"
- "static-code-analysis"
- "phpmd"
- "rector"
steps:
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0