feat: add compatibility with JobRouter 2024.1 #308
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths-ignore: | |
- .editorconfig | |
- .gitattributes | |
- .gitignore | |
- docs/** | |
- README.md | |
pull_request: | |
paths-ignore: | |
- .editorconfig | |
- .gitattributes | |
- .gitignore | |
- docs/** | |
- README.md | |
jobs: | |
build-php: | |
name: Build PHP | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup PHP version | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: curl filter json | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install composer dependencies | |
run: | | |
composer remove infection/infection maglnet/composer-require-checker symplify/phpstan-rules --dev --no-update | |
composer install --prefer-dist --no-progress --no-suggest | |
- name: Run PHP linter | |
run: | | |
find . -type f -name '*.php' ! -path "./vendor/*" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) | |
- name: Run unit tests | |
run: | | |
make tests | |
code-quality: | |
name: Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Setup PHP version | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
coverage: xdebug | |
extensions: curl filter json | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install composer dependencies | |
run: | | |
composer update --prefer-dist --no-progress | |
- name: Normalize composer.json | |
run: | | |
composer normalize --dry-run | |
- name: Check composer require | |
run: | | |
vendor/bin/composer-require-checker check | |
- name: Check coding standards | |
run: | | |
vendor/bin/ecs check --no-progress-bar | |
- name: Run mutation tests | |
run: | | |
make mutation | |
- name: Run phpstan | |
run: | | |
make phpstan | |
- name: Run rector | |
run: | | |
make rector-dry |