build #151
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: build | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ "main" ] | |
push: | |
branches: [ "main" ] | |
schedule: | |
- cron: '0 16 * * 0' # sunday 16:00 | |
# Actions | |
# shivammathur/setup-php@v2 https://github.com/marketplace/actions/setup-php-action | |
jobs: | |
composer-normalize: | |
name: Composer normalization | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
coverage: none | |
tools: composer-normalize | |
env: | |
fail-fast: true | |
- name: Composer normalize | |
run: composer-normalize | |
phpcs: | |
name: Code style (phpcs) | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
coverage: none | |
tools: cs2pr, phpcs | |
env: | |
fail-fast: true | |
- name: Code style (phpcs) | |
run: phpcs -q --report=checkstyle | cs2pr | |
php-cs-fixer: | |
name: Code style (php-cs-fixer) | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
coverage: none | |
tools: cs2pr, php-cs-fixer | |
env: | |
fail-fast: true | |
- name: Code style (php-cs-fixer) | |
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr | |
phpstan: | |
name: Code analysis (phpstan) | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
coverage: none | |
tools: composer:v2, cs2pr, phpstan | |
env: | |
fail-fast: true | |
- 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@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install project dependencies | |
run: composer upgrade --no-interaction --no-progress --prefer-dist | |
- name: PHPStan | |
run: phpstan analyse --no-progress | |
psalm: | |
name: Code analysis (psalm) | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
coverage: none | |
tools: composer:v2, cs2pr, psalm | |
env: | |
fail-fast: true | |
- 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@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install project dependencies | |
run: composer upgrade --no-interaction --no-progress --prefer-dist | |
- name: Psalm version | |
run: psalm --version | |
- name: Psalm | |
run: psalm --no-progress --output-format=github | |
tests: | |
name: Tests on PHP ${{ matrix.php-version }} | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: ['8.3'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
coverage: none | |
tools: composer:v2 | |
env: | |
fail-fast: true | |
- 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@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install project dependencies | |
run: composer upgrade --no-interaction --no-progress --prefer-dist | |
- name: Tests (phpunit) | |
run: vendor/bin/phpunit --testdox |