preparing for initial release #1
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: [ 8.2, 8.3 ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: pcov | |
- 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.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Cache vendor directory | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-vendor- | |
- name: Run PHPStan | |
run: composer lint | |
- name: Run PHP CS Fixer | |
run: composer format -- --dry-run --diff | |
- name: Run PHPUnit | |
run: composer test |