Skip to content

Build

Build #313

Workflow file for this run

name: Build
on:
push:
branches-ignore:
- 'dependabot/**'
paths-ignore:
- "docs/**"
- "*.md"
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
workflow_dispatch: ~
jobs:
tests:
runs-on: ubuntu-latest
name: "PHP ${{ matrix.php }}"
strategy:
fail-fast: false
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1]
steps:
-
uses: actions/checkout@v3
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: xdebug
-
name: Get Composer cache directory
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
id: composer-cache
-
name: Cache Composer
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
-
name: Install PHP dependencies
run: composer install --no-interaction
-
name: Check Composer
run: composer validate --strict
-
name: ECS analysis
run: vendor/bin/ecs check .
-
name: PHPStan analysis
run: vendor/bin/phpstan analyse -l max src/
-
name: Run PHPUnit
run: vendor/bin/phpunit --coverage-clover coverage.xml
-
name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: coverage.xml
verbose: true