Main #939
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: Main | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
run: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
dependencies: ["lowest", "highest"] | |
php-versions: ["8.1", "8.2", "8.3"] | |
name: PHP ${{ matrix.php-versions }} Test with ${{ matrix.dependencies }} dependencies on ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, intl | |
coverage: pcov | |
tools: cs2pr | |
- name: Setup problem matchers for PHP | |
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install locked dependencies | |
if: ${{ matrix.dependencies == 'highest' && matrix.php-versions == '8.3' }} | |
run: composer install --no-progress | |
- name: Use lowest dependencies | |
if: ${{ matrix.dependencies == 'lowest' }} | |
run: composer update --prefer-lowest --no-progress | |
- name: Use highest dependencies | |
if: ${{ matrix.dependencies == 'highest' && matrix.php-versions != '8.3' }} | |
run: composer update --no-progress | |
- name: PHP CodeSniffer | |
run: composer phpcs | |
- name: PHPUnit | |
run: composer phpunit | |
- name: PHPStan | |
run: composer stan -- --error-format=checkstyle | cs2pr |