Merge pull request #48 from PHPCSStandards/feature/update-phpcs-xsd-s… #94
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: CI | |
on: | |
# Run on all pushes and pull requests. | |
push: | |
branches: | |
- main | |
pull_request: | |
# Also run this workflow on day 10 of every month as the repo isn't that active. | |
schedule: | |
- cron: '0 0 10 * *' | |
# Allow manually triggering the workflow. | |
workflow_dispatch: | |
jobs: | |
xmllint: | |
name: 'Check install and XML' | |
runs-on: ubuntu-latest | |
env: | |
XMLLINT_INDENT: ' ' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 'latest' | |
coverage: none | |
# Install dependencies to make sure the PHPCS XSD file is available. | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-interaction --no-progress | |
# Validate the composer.json file. | |
# @link https://getcomposer.org/doc/03-cli.md#validate | |
- name: Validate Composer installation | |
run: composer validate --no-check-all --strict | |
# Validate the xml file. | |
- name: Validate against schema | |
uses: phpcsstandards/xmllint-validate@v1 | |
with: | |
pattern: "PHPCSDev/ruleset.xml" | |
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd" | |
# Check the code-style consistency of the xml file. | |
# Note: this needs xmllint, but that will be installed via the phpcsstandards/xmllint-validate action runner. | |
- name: Check code style | |
run: diff -B ./PHPCSDev/ruleset.xml <(xmllint --format "./PHPCSDev/ruleset.xml") |