|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - # Run on all pushes and pull requests. |
| 4 | + # Run on pushes to `main` and on all pull requests. |
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - main |
8 | 8 | pull_request: |
9 | | - # Also run this workflow on day 10 of every month as the repo isn't that active. |
10 | | - schedule: |
11 | | - - cron: '0 0 10 * *' |
12 | 9 | # Allow manually triggering the workflow. |
13 | 10 | workflow_dispatch: |
14 | 11 |
|
15 | 12 | jobs: |
16 | | - xmllint: |
17 | | - # Don't run the cron job on forks. |
18 | | - if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }} |
19 | | - |
20 | | - name: 'Check install and XML' |
21 | | - runs-on: ubuntu-latest |
22 | | - |
23 | | - env: |
24 | | - XMLLINT_INDENT: ' ' |
25 | | - |
26 | | - steps: |
27 | | - - name: Checkout code |
28 | | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
29 | | - with: |
30 | | - persist-credentials: false |
31 | | - |
32 | | - - name: Install PHP |
33 | | - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5 |
34 | | - with: |
35 | | - php-version: 'latest' |
36 | | - coverage: none |
37 | | - |
38 | | - # Install dependencies to make sure the PHPCS XSD file is available. |
39 | | - - name: Install dependencies |
40 | | - run: composer install --prefer-dist --no-interaction --no-progress |
41 | | - |
42 | | - # Validate the composer.json file. |
43 | | - # @link https://getcomposer.org/doc/03-cli.md#validate |
44 | | - - name: Validate Composer installation |
45 | | - run: composer validate --no-check-all --strict |
46 | | - |
47 | | - # Validate the xml file. |
48 | | - - name: Validate against schema |
49 | | - uses: phpcsstandards/xmllint-validate@0fd9c4a9046055f621fca4bbdccb8eab1fd59fdc # v1.0.1 |
50 | | - with: |
51 | | - pattern: "PHPCSDev/ruleset.xml" |
52 | | - xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd" |
53 | | - |
54 | | - # Check the code-style consistency of the xml file. |
55 | | - # Note: this needs xmllint, but that will be installed via the phpcsstandards/xmllint-validate action runner. |
56 | | - - name: Check code style |
57 | | - run: diff -B ./PHPCSDev/ruleset.xml <(xmllint --format "./PHPCSDev/ruleset.xml") |
| 13 | + QA: |
| 14 | + uses: ./.github/workflows/reusable-qa-checks.yml |
0 commit comments