Skip to content

Continuous Integration #2191

Continuous Integration

Continuous Integration #2191

# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Continuous Integration"
on:
pull_request:
push:
branches:
- "*.*.x"
schedule:
- cron: "0 17 * * *"
jobs:
coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-22.04"
strategy:
matrix:
php-version:
- "7.2"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
- name: "Run squizlabs/php_codesniffer"
run: "vendor/bin/phpcs"
validate-against-schema:
name: "Validate against schema"
runs-on: "ubuntu-22.04"
strategy:
matrix:
php-version:
- "7.2"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
- name: "Build Docker image"
uses: "./.docker/validate-against-schema"
- name: "Lint XML configuration files"
uses: "./.docker/validate-against-schema"
with:
args: "xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd lib/Doctrine/ruleset.xml"
test-report:
name: "Test report"
runs-on: "ubuntu-22.04"
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
- name: "Test reports"
run: "make test-report"
test-fixes:
name: "Test fixes"
runs-on: "ubuntu-22.04"
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
- name: "Test fixes"
run: "make test-fix"