2020-12-12 16:30:17 +01:00
|
|
|
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
|
|
|
|
|
|
|
name: "Build"
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-08-09 14:20:06 +02:00
|
|
|
- "1.6.x"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
name: "Lint"
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php-version:
|
|
|
|
- "7.2"
|
|
|
|
- "7.3"
|
|
|
|
- "7.4"
|
|
|
|
- "8.0"
|
2021-12-16 20:47:28 +01:00
|
|
|
- "8.1"
|
2022-07-19 13:14:43 +02:00
|
|
|
- "8.2"
|
|
|
|
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout"
|
2022-03-07 01:03:13 +01:00
|
|
|
uses: actions/checkout@v3
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Install PHP"
|
|
|
|
uses: "shivammathur/setup-php@v2"
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
|
|
|
php-version: "${{ matrix.php-version }}"
|
|
|
|
|
|
|
|
- name: "Validate Composer"
|
|
|
|
run: "composer validate"
|
|
|
|
|
|
|
|
- name: "Install dependencies"
|
2021-12-16 19:38:40 +01:00
|
|
|
run: "composer install --no-interaction --no-progress"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
2021-05-16 14:15:56 +02:00
|
|
|
- name: "Downgrade PHPUnit"
|
2022-03-28 09:15:57 +02:00
|
|
|
if: matrix.php-version == '7.2' || matrix.php-version == '7.3'
|
2021-05-16 14:15:56 +02:00
|
|
|
run: "composer require --dev phpunit/phpunit:^7.5.20 --update-with-dependencies"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Lint"
|
2021-05-16 07:47:23 +02:00
|
|
|
run: "make lint"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
coding-standards:
|
|
|
|
name: "Coding Standard"
|
|
|
|
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout"
|
2022-03-07 01:03:13 +01:00
|
|
|
uses: actions/checkout@v3
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Install PHP"
|
|
|
|
uses: "shivammathur/setup-php@v2"
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
2021-03-18 21:54:00 +01:00
|
|
|
php-version: "8.0"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Validate Composer"
|
|
|
|
run: "composer validate"
|
|
|
|
|
|
|
|
- name: "Install dependencies"
|
2021-12-16 19:38:40 +01:00
|
|
|
run: "composer install --no-interaction --no-progress"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Lint"
|
2021-05-16 07:47:23 +02:00
|
|
|
run: "make lint"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Coding Standard"
|
2021-05-16 07:47:23 +02:00
|
|
|
run: "make cs"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
tests:
|
|
|
|
name: "Tests"
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
php-version:
|
|
|
|
- "7.2"
|
|
|
|
- "7.3"
|
|
|
|
- "7.4"
|
|
|
|
- "8.0"
|
2021-12-16 20:47:28 +01:00
|
|
|
- "8.1"
|
2022-07-19 13:14:43 +02:00
|
|
|
- "8.2"
|
2020-12-12 16:30:17 +01:00
|
|
|
dependencies:
|
|
|
|
- "lowest"
|
|
|
|
- "highest"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout"
|
2022-03-07 01:03:13 +01:00
|
|
|
uses: actions/checkout@v3
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Install PHP"
|
|
|
|
uses: "shivammathur/setup-php@v2"
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
|
|
|
php-version: "${{ matrix.php-version }}"
|
|
|
|
|
|
|
|
- name: "Install lowest dependencies"
|
|
|
|
if: ${{ matrix.dependencies == 'lowest' }}
|
2021-12-16 19:38:40 +01:00
|
|
|
run: "composer update --prefer-lowest --no-interaction --no-progress"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Install highest dependencies"
|
|
|
|
if: ${{ matrix.dependencies == 'highest' }}
|
2021-12-16 19:38:40 +01:00
|
|
|
run: "composer update --no-interaction --no-progress"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
2021-05-16 14:15:56 +02:00
|
|
|
- name: "Downgrade PHPUnit"
|
2022-03-28 09:15:57 +02:00
|
|
|
if: matrix.php-version == '7.2' || matrix.php-version == '7.3'
|
2021-05-16 14:15:56 +02:00
|
|
|
run: "composer require --dev phpunit/phpunit:^7.5.20 --update-with-dependencies"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Tests"
|
2021-05-16 07:47:23 +02:00
|
|
|
run: "make tests"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
static-analysis:
|
|
|
|
name: "PHPStan"
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
php-version:
|
|
|
|
- "7.2"
|
|
|
|
- "7.3"
|
|
|
|
- "7.4"
|
|
|
|
- "8.0"
|
2021-12-16 20:47:28 +01:00
|
|
|
- "8.1"
|
2022-07-19 13:14:43 +02:00
|
|
|
- "8.2"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout"
|
2022-03-07 01:03:13 +01:00
|
|
|
uses: actions/checkout@v3
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "Install PHP"
|
|
|
|
uses: "shivammathur/setup-php@v2"
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
|
|
|
php-version: "${{ matrix.php-version }}"
|
|
|
|
extensions: mbstring
|
|
|
|
tools: composer:v2
|
|
|
|
|
2021-03-26 19:43:54 +01:00
|
|
|
- name: "Install dependencies"
|
2021-12-16 19:38:40 +01:00
|
|
|
run: "composer update --no-interaction --no-progress"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
2021-05-16 14:15:56 +02:00
|
|
|
- name: "Downgrade PHPUnit"
|
2022-03-28 09:15:57 +02:00
|
|
|
if: matrix.php-version == '7.2' || matrix.php-version == '7.3'
|
2021-05-16 14:15:56 +02:00
|
|
|
run: "composer require --dev phpunit/phpunit:^7.5.20 --update-with-dependencies"
|
2020-12-12 16:30:17 +01:00
|
|
|
|
|
|
|
- name: "PHPStan"
|
2021-05-16 07:47:23 +02:00
|
|
|
run: "make phpstan"
|