-
Notifications
You must be signed in to change notification settings - Fork 3
132 lines (112 loc) · 3.76 KB
/
build.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: "Build"
on:
push:
paths-ignore:
- '**.md'
- '.appveyor.yml'
- '.editorconfig'
- '.gitattributes'
- 'LICENSE'
pull_request:
paths-ignore:
- '**.md'
- '.appveyor.yml'
- '.editorconfig'
- '.gitattributes'
- 'LICENSE'
# Allow manually triggering the workflow
workflow_dispatch:
jobs:
test:
name: "Run the test suite"
runs-on: "ubuntu-latest"
continue-on-error: ${{ matrix.experimental == true }}
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
strategy:
matrix:
php-version:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
tools:
- "composer:v1"
- "composer:v2"
include:
- php-version: "8.2"
tools: "composer:v2"
- php-version: "8.3"
tools: "composer:v2"
composer-options: "--ignore-platform-reqs"
experimental: true
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
ini-values: "error_reporting=-1, display_errors=On, zend.assertions=1"
tools: "${{ matrix.tools }}"
php-version: "${{ matrix.php-version }}"
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "${{ matrix.composer-options }}"
- name: "Check PHP syntax"
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -n1 -P4 -- php -l -f"
- name: "Run the test suite"
run: "composer test"
bc-tests:
name: "Run backward compatibility tests"
runs-on: "ubuntu-latest"
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
tools: "composer:v2"
php-version: "8.0"
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
- name: "Run the backward compatibility tests"
run: "composer test:bc"
analysis:
name: "Run static analysis"
runs-on: "ubuntu-latest"
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
tools: "composer:v2, composer-normalize, phpstan"
php-version: "8.0"
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
- name: "Normalize composer.json"
run: "composer-normalize --dry-run --no-check-lock --no-update-lock"
- name: "Check for PSR-4 violations"
run: "composer dump-autoload --optimize --strict-psr --no-scripts"
- name: "PHPStan Analyse"
run: "phpstan analyse --error-format=github"