Skip to content

Commit 8264c14

Browse files
committed
ci: split workflow
1 parent 9b4d1ca commit 8264c14

File tree

4 files changed

+94
-41
lines changed

4 files changed

+94
-41
lines changed

.github/actions/setup/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Setup
2+
description: "Setup PHP and composer and install dependencies"
3+
4+
inputs:
5+
php-version:
6+
default: "8.3"
7+
coverage:
8+
default: xdebug
9+
composer-flags:
10+
default: ""
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Install PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: ${{ inputs.php-version }}
19+
coverage: ${{ inputs.coverage }}
20+
21+
- name: Get composer cache directory
22+
id: composer-cache
23+
shell: bash
24+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
25+
26+
- name: Cache dependencies
27+
uses: actions/cache@v4
28+
with:
29+
path: ${{ steps.composer-cache.outputs.dir }}
30+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
31+
restore-keys: ${{ runner.os }}-composer-
32+
33+
- name: Install dependencies
34+
shell: bash
35+
run: composer update --prefer-dist --no-interaction ${{ inputs.composer-flags }}

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
phpcs:
11+
runs-on: ubuntu-24.04
12+
name: PHPCS
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Setup
18+
uses: ./.github/actions/setup
19+
with:
20+
coverage: none
21+
22+
- name: Run PHPCS
23+
run: vendor/bin/phpcs
24+
25+
phpstan:
26+
runs-on: ubuntu-24.04
27+
name: PHPStan
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v2
31+
32+
- name: Setup
33+
uses: ./.github/actions/setup
34+
with:
35+
coverage: none
36+
37+
- name: Run PHPStan
38+
run: vendor/bin/phpstan analyse
39+
40+
test:
41+
runs-on: ubuntu-24.04
42+
strategy:
43+
max-parallel: 3
44+
matrix:
45+
php-version: [ 8.2, 8.3 ]
46+
composer-flags: [ "", "--prefer-lowest" ]
47+
name: Test on PHP ${{ matrix.php-version }} ${{ matrix.composer-flags }}
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v2
51+
52+
- name: Setup
53+
uses: ./.github/actions/setup
54+
with:
55+
php-version: ${{ matrix.php-version }}
56+
composer-flags: ${{ matrix.composer-flags }}
57+
58+
- name: Run tests (Unit and Feature)
59+
run: vendor/bin/phpunit --coverage-text

.github/workflows/test.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ parameters:
33
- src
44
level: 8
55
inferPrivatePropertyTypeFromConstructor: true
6-
checkMissingIterableValueType: false
76
reportUnmatchedIgnoredErrors: false

0 commit comments

Comments
 (0)