Configure Mend Bolt for GitHub #165
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: | |
- pull_request | |
- push | |
jobs: | |
tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- operating-system: 'ubuntu-latest' | |
php-version: '8.1' | |
- operating-system: 'ubuntu-latest' | |
php-version: '8.2' | |
name: PHP ${{ matrix.php-version }} | |
runs-on: ${{ matrix.operating-system }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
tools: flex | |
env: | |
fail-fast: false # disabled as old PHP version cannot run flex | |
update: ${{ matrix.php-version == '8.0' }} # force update to 8.0.1+, ref https://github.com/shivammathur/setup-php/issues/394#issuecomment-760461251 | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }} | |
restore-keys: | | |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}- | |
composer-${{ runner.os }}-${{ matrix.php-version }}- | |
composer-${{ runner.os }}- | |
composer- | |
- name: Install dependencies | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
retry_wait_seconds: 30 | |
command: | | |
composer update --optimize-autoloader --no-interaction --no-progress ${{ matrix.composer-flags }} | |
composer info -D | |
- name: Run PHP CS Fixer | |
run: PHP_CS_FIXER_IGNORE_ENV=1 composer run-script code-style-check | |
- name: Run PHPSTAN | |
run: composer run-script static-analysis | |
- name: Run UNIT-TESTS | |
run: composer run-script unit-test |