enable checkBenevolentUnionTypes #97
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
# Based on https://github.com/slevomat/coding-standard/blob/5730c4cdace33d2fb073b7d125dc64719f869d2b/.github/workflows/build.yml | |
name: "Build" | |
on: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
jobs: | |
coding-standards: | |
name: "Coding standards" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "8.2" | |
- 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.json') }}" | |
restore-keys: "${{ runner.os }}-composer-" | |
- name: "Install dependencies" | |
run: "composer update --prefer-dist --no-interaction --no-progress" | |
- name: "Coding Standard" | |
run: "make cs" | |
static-analysis: | |
name: "Static analysis" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "8.2" | |
- 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.json') }}" | |
restore-keys: "${{ runner.os }}-composer-" | |
- name: "Install dependencies" | |
run: "composer update --prefer-dist --no-interaction --no-progress" | |
- name: "PHPStan" | |
run: "make phpstan" | |
tests: | |
name: "Tests" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
dependencies: ["lowest", "highest"] | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
services: | |
mariadb: | |
image: "mariadb:10.11.5-jammy" | |
env: | |
MARIADB_ALLOW_EMPTY_PASSWORD: yes | |
MARIADB_DATABASE: "mariastan_test" | |
MARIADB_ROOT_PASSWORD: "root" | |
options: >- | |
--health-cmd "mysqladmin ping --silent" | |
ports: | |
- "3306:3306" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
extensions: mysqli | |
- 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.json') }}" | |
restore-keys: "${{ runner.os }}-composer-" | |
- name: "Install lowest dependencies" | |
if: ${{ matrix.dependencies == 'lowest' }} | |
run: "composer update --prefer-lowest --prefer-dist --no-interaction --no-progress" | |
- name: "Install highest dependencies" | |
if: ${{ matrix.dependencies == 'highest' }} | |
run: "composer update --prefer-dist --no-interaction --no-progress" | |
- name: "Tests" | |
run: "make tests" |