-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.64 KB
/
lint-php-cs.yml
File metadata and controls
66 lines (53 loc) · 1.64 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
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Lint PHP CS
on:
push:
pull_request:
permissions:
contents: read
concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
php-version:
runs-on: ubuntu-latest
outputs:
min: ${{ steps.php.outputs.min }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Read PHP min version from composer.json
id: php
run: |
min=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | head -1)
echo "min=$min" >> $GITHUB_OUTPUT
cs-check:
runs-on: ubuntu-latest
needs: php-version
name: php-cs
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up PHP ${{ needs.php-version.outputs.min }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ needs.php-version.outputs.min }}
tools: composer:v2
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Check coding standard
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
summary:
runs-on: ubuntu-latest
needs: cs-check
if: always()
name: lint-php-cs-summary
steps:
- name: Summary status
run: if ${{ needs.cs-check.result != 'success' && needs.cs-check.result != 'skipped' }}; then exit 1; fi