updates #82
Workflow file for this run
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: Continuous Integration | |
| on: | |
| push: | |
| branches: | |
| - 'develop' | |
| - 'main' | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| concurrency: | |
| group: '${{ github.workflow }}-${{ github.ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| composer-validate: | |
| name: 'Validate the composer.json file' | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: 'Setup PHP' | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v6 | |
| - name: 'Composer validate' | |
| run: composer validate --no-check-all --strict | |
| ruleset-validate: | |
| name: 'Validate the WordPress rulesets' | |
| runs-on: 'ubuntu-latest' | |
| env: | |
| XMLLINT_INDENT: ' ' | |
| steps: | |
| - name: 'Setup PHP' | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: 'Install xmllint' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --no-install-recommends -y libxml2-utils | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v6 | |
| - name: 'Install Composer dependencies' | |
| uses: ramsey/composer-install@4.0.0 | |
| # Show XML violations inline in the file diff. | |
| # @link https://github.com/marketplace/actions/xmllint-problem-matcher | |
| - uses: korelstar/xmllint-problem-matcher@v1 | |
| # Validate the Ruleset XML files. | |
| # @link http://xmlsoft.org/xmllint.html | |
| - name: 'Validate the WordPress rulesets' | |
| run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml | |
| - name: 'Validate the sample ruleset' | |
| run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd ./phpcs.xml.dist.sample | |
| # Validate the Documentation XML files. | |
| - name: 'Validate documentation against schema' | |
| run: xmllint --noout --schema vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd ./Eightshift/Docs/*/*Standard.xml | |
| - name: 'Check the code-style consistency of the xml files' | |
| run: | | |
| diff -B --tabsize=4 ./Eightshift/ruleset.xml <(xmllint --format "./Eightshift/ruleset.xml") | |
| diff -B --tabsize=4 ./phpcs.xml.dist.sample <(xmllint --format "./phpcs.xml.dist.sample") | |
| feature-completeness: | |
| name: 'Check sniff feature completeness' | |
| needs: [composer-validate, ruleset-validate] | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: 'Setup PHP' | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v6 | |
| - name: 'Install Composer dependencies' | |
| uses: ramsey/composer-install@4.0.0 | |
| - name: 'Check sniff feature completeness' | |
| run: composer test:check-complete | |
| lint: | |
| name: 'Lint: PHP 8.4' | |
| needs: [composer-validate, ruleset-validate] | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: 'Set up PHP' | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| tools: cs2pr, composer:v2 | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v6 | |
| - name: 'Install Composer dependencies' | |
| uses: ramsey/composer-install@4.0.0 | |
| - name: Lint against parse errors | |
| run: composer test:standards | |
| phpstan: | |
| name: 'PHPStan checks' | |
| needs: [composer-validate, ruleset-validate] | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: 'Set up PHP' | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| tools: phpstan, composer:v2 | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v6 | |
| - name: 'Install Composer dependencies' | |
| uses: 'ramsey/composer-install@4.0.0' | |
| - name: 'Run PHPStan' | |
| run: composer test:types | |
| rector: | |
| name: 'Rector checks' | |
| needs: [composer-validate, ruleset-validate] | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: 'Set up PHP' | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v6 | |
| - name: 'Install Composer dependencies' | |
| uses: ramsey/composer-install@4.0.0 | |
| - name: 'Run Rector' | |
| run: composer test:rector | |
| tests: | |
| name: 'Unit tests' | |
| needs: [composer-validate, ruleset-validate] | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.allowed_failure }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| allowed_failure: [false] | |
| steps: | |
| - name: 'Setup ini config' | |
| id: set_ini | |
| run: | | |
| echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT | |
| - name: 'Setup PHP' | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| ini-values: ${{ steps.set_ini.outputs.PHP_INI }} | |
| coverage: none | |
| tools: composer:v2 | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v6 | |
| - name: 'Install Composer dependencies' | |
| uses: ramsey/composer-install@4.0.0 | |
| - name: 'Test the Eightshift ruleset' | |
| run: composer test:unit-checkcs | |
| - name: 'Run the unit tests' | |
| run: composer test:unit |