Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI Cronjob

on:
# Run this workflow on day 10 of every month as the repo isn't that active.
schedule:
- cron: '0 0 10 * *'

permissions: {}

jobs:
QA:
# Don't run the cron job on forks.
if: ${{ github.event.repository.fork == false }}

uses: ./.github/workflows/reusable-qa-checks.yml
49 changes: 3 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,14 @@
name: CI

on:
# Run on all pushes and pull requests.
# Run on pushes to `main` and on all 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:
# Don't run the cron job on forks.
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}

name: 'Check install and XML'
runs-on: ubuntu-latest

env:
XMLLINT_INDENT: ' '

steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
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@0fd9c4a9046055f621fca4bbdccb8eab1fd59fdc # v1.0.1
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")
QA:
uses: ./.github/workflows/reusable-qa-checks.yml
47 changes: 47 additions & 0 deletions .github/workflows/reusable-qa-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
workflow_call:

permissions: {}

jobs:
xmllint:
name: 'Check install and XML'
runs-on: ubuntu-latest

env:
XMLLINT_INDENT: ' '

steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
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@0fd9c4a9046055f621fca4bbdccb8eab1fd59fdc # v1.0.1
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")