diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..780d647 --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,51 @@ +on: + push: + branches: + - latest + pull_request: + # Allow manually triggering the workflow. + workflow_dispatch: + +name: qa +jobs: + xmllint: + name: 'Check install and XML' + runs-on: ubuntu-latest + + env: + XMLLINT_INDENT: ' ' + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + + # 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 + + # Install dependencies to make sure the PHPCS XSD file is available. + - name: Install dependencies + run: composer install --prefer-dist --no-interaction --no-progress + + - name: Setup xmllint + run: sudo apt-get install --no-install-recommends -y libxml2-utils + + # Show violations inline in the file diff. + # @link https://github.com/marketplace/actions/xmllint-problem-matcher + - uses: korelstar/xmllint-problem-matcher@v1 + + # Validate the xml file. + # @link http://xmlsoft.org/xmllint.html + - name: Validate against schema + run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd lib/phpDocumentor/ruleset.xml + + # Check the code-style consistency of the xml file. + - name: Check code style + run: diff -B ./lib/phpDocumentor/ruleset.xml <(xmllint --format "./lib/phpDocumentor/ruleset.xml") diff --git a/lib/phpDocumentor/ruleset.xml b/lib/phpDocumentor/ruleset.xml index 58bb44d..57de6e7 100644 --- a/lib/phpDocumentor/ruleset.xml +++ b/lib/phpDocumentor/ruleset.xml @@ -1,25 +1,21 @@ - + The phpDocumentor coding standard. - - - + + + - - + + - +