-
Notifications
You must be signed in to change notification settings - Fork 647
95 lines (81 loc) · 2.48 KB
/
php-checks.yml
File metadata and controls
95 lines (81 loc) · 2.48 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
90
91
92
93
94
95
name: PHP Checks
on:
push:
pull_request:
merge_group:
workflow_dispatch:
jobs:
tests:
name: Run checks on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
php:
- 8.2
- 8.3
- 8.4
- 8.5
include:
- php: 8.2
analysis: true
- php: 8.3
analysis: true
- php: 8.4
analysis: true
- php: 8.5
analysis: true
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
with:
php-version: ${{ matrix.php }}
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '17'
- name: Generate code
run: python generate-code.py
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies with Composer
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
- name: Check copyrights
if: matrix.analysis
run: composer copyright
- name: Check code style with PHP_CodeSniffer
if: matrix.analysis
run: composer cs
- name: Check with PHP Mess Detector
if: matrix.analysis
run: composer md
- name: Check with PHPStan
if: matrix.analysis
run: composer stan
- name: Run unit tests
if: matrix.analysis
run: composer test
pinact:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run pinact
uses: suzuki-shunsuke/pinact-action@896d595f299e71d65b9d28349d6956abe144390a # v3.0.0
with:
skip_push: "true"