GH Actions: Bump ramsey/composer-install from 2 to 3 #29
This file contains 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: QA | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
- master | |
# Allow manually triggering the workflow. | |
workflow_dispatch: | |
# Cancels all previous workflow runs for the same branch that have not yet completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check: | |
name: 'Basic QA checks' | |
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 | |
tools: cs2pr | |
# 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 | |
# Verify the package can be installed succesfully. | |
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
# Bust the cache at least once a month - output format: YYYY-MM. | |
custom-cache-suffix: $(date -u "+%Y-%m") | |
- name: Install xmllint | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y libxml2-utils | |
# Show XML violations inline in the file diff. | |
# @link https://github.com/marketplace/actions/xmllint-problem-matcher | |
- name: Enable showing XML issues inline | |
uses: korelstar/xmllint-problem-matcher@v1 | |
# Validate the ruleset XML file. | |
# @link http://xmlsoft.org/xmllint.html | |
- name: Validate ruleset against XML schema | |
run: xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./PHPParallelLint/ruleset.xml | |
# Check the code-style consistency of the XML ruleset files. | |
- name: Check XML ruleset code style | |
run: diff -B --tabsize=4 ./PHPParallelLint/ruleset.xml <(xmllint --format "./PHPParallelLint/ruleset.xml") |