-
Notifications
You must be signed in to change notification settings - Fork 22
89 lines (73 loc) · 2.08 KB
/
ci.yml
File metadata and controls
89 lines (73 loc) · 2.08 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI with Composer scripts
on:
push:
paths:
- '**.php'
- '.github/workflows/ci.yml'
- 'Build/phpunit/FunctionalTests.xml'
- 'Build/phpunit/UnitTests.xml'
- 'composer.json'
branches:
- main
pull_request:
permissions:
contents: read
jobs:
php-lint:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
php: [8.2, 8.3, 8.4]
name: "PHP linter - ${{ matrix.php }}"
steps:
- name: "Checkout code"
uses: actions/checkout@v6
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
- name: "Run PHP lint"
run: find .*.php *.php Classes Configuration -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l
code-quality:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
command:
- "composer:normalize"
- "composer:psr-verify"
- "php:ecs"
- "php:rector"
- "php:fractor"
- "php:stan"
php: [8.2]
name: "Code quality checks"
steps:
- name: "Checkout code"
uses: actions/checkout@v6
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
tools: composer:v2
- name: "Show Composer version"
run: composer --version
- name: "Show the Composer configuration"
run: composer config --global --list
- name: "Cache dependencies installed with composer"
uses: actions/cache@v5
with:
key: "php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php }}-composer-\n"
- name: "Install Composer dependencies"
run: composer install --no-progress
- name: "List Installed Dependencies"
run: composer show -D
- name: "Run command"
run: composer ci:${{ matrix.command }}