-
Notifications
You must be signed in to change notification settings - Fork 498
63 lines (52 loc) · 2.09 KB
/
lint.yml
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
name: Lint
on:
# Run on all pushes and on all pull requests.
push:
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint: #----------------------------------------------------------------------
runs-on: ubuntu-latest
strategy:
matrix:
# Lint against the high/low versions of each PHP major + nightly.
php: ['5.6', '7.0', '7.4', '8.0', '8.3', '8.4']
name: "Lint: PHP ${{ matrix.php }}"
continue-on-error: ${{ matrix.php == '8.4' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=-1, display_errors=On, log_errors_max_len=0
coverage: none
tools: cs2pr
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies - normal
if: ${{ matrix.php != '8.4' }}
uses: "ramsey/composer-install@v3"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
# For PHP "nightly", we need to install with ignore platform reqs.
- name: Install Composer dependencies - with ignore platform
if: ${{ matrix.php == '8.4' }}
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"
custom-cache-suffix: $(date -u "+%Y-%m")
- name: Lint against parse errors
if: ${{ matrix.php >= '7.2' }}
run: composer lint -- --checkstyle | cs2pr
- name: Lint against parse errors
if: ${{ matrix.php < '7.2' }}
run: composer lint -- --exclude build --checkstyle | cs2pr