Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Setup
description: "Setup PHP and composer and install dependencies"

inputs:
php-version:
default: "8.3"
coverage:
default: xdebug
composer-flags:
default: ""

runs:
using: "composite"
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: ${{ inputs.coverage }}

- name: Get composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
shell: bash
run: composer update --prefer-dist --no-interaction ${{ inputs.composer-flags }}
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
phpcs:
runs-on: ubuntu-24.04
name: PHPCS
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup
uses: ./.github/actions/setup
with:
coverage: none

- name: Run PHPCS
run: vendor/bin/phpcs

phpstan:
runs-on: ubuntu-24.04
name: PHPStan
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup
uses: ./.github/actions/setup
with:
coverage: none

- name: Run PHPStan
run: vendor/bin/phpstan analyse

test:
runs-on: ubuntu-24.04
strategy:
max-parallel: 3
matrix:
php-version: [ 8.2, 8.3 ]
composer-flags: [ "", "--prefer-lowest" ]
name: Test on PHP ${{ matrix.php-version }} ${{ matrix.composer-flags }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup
uses: ./.github/actions/setup
with:
php-version: ${{ matrix.php-version }}
composer-flags: ${{ matrix.composer-flags }}

- name: Run tests (Unit and Feature)
run: vendor/bin/phpunit --coverage-text
40 changes: 0 additions & 40 deletions .github/workflows/test.yml

This file was deleted.

1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ parameters:
- src
level: 8
inferPrivatePropertyTypeFromConstructor: true
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: false