-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (55 loc) · 2.12 KB
/
qa.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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")