-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (54 loc) · 1.52 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, edited, reopend, synchronize]
jobs:
test:
name: PHPUnit (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ["7.4", "8.0", "8.1"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json, openssl, zlib, zip
- name: Composer install
uses: ramsey/composer-install@v3
with:
composer-options: "--no-scripts"
- name: Run unit tests
run: vendor/bin/phpunit --testdox
lint:
name: Check code style
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: json, openssl, zlib, zip
- name: Composer install
uses: ramsey/composer-install@v3
with:
composer-options: "--no-scripts"
- name: Run php-cs-fixer
run: vendor/bin/php-cs-fixer fix
- name: Apply php-cs-fixer changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply php-cs-fixer changes