Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit 148f847

Browse files
committed
Added CI run
1 parent 2303ea2 commit 148f847

File tree

1 file changed

+175
-0
lines changed

1 file changed

+175
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: "CI"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'master'
8+
9+
env:
10+
fail-fast: true
11+
TZ: "Europe/Paris"
12+
REQUIRED_PHP_EXTENSIONS: "dom"
13+
14+
jobs:
15+
composer-validate:
16+
name: "Composer validate (${{ matrix.php-version }})"
17+
18+
runs-on: "ubuntu-latest"
19+
20+
strategy:
21+
matrix:
22+
php-version:
23+
- '7.2'
24+
25+
steps:
26+
-
27+
name: "Checkout code"
28+
uses: "actions/checkout@v2"
29+
30+
-
31+
name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
coverage: "none"
35+
php-version: "${{ matrix.php-version }}"
36+
tools: composer:v2
37+
38+
-
39+
name: "Validate composer.json"
40+
run: "composer validate --strict --no-check-lock"
41+
42+
php-cs-fixer:
43+
needs:
44+
- "composer-validate"
45+
46+
name: "PHP-CS-Fixer (${{ matrix.php-version }})"
47+
48+
runs-on: "ubuntu-latest"
49+
50+
strategy:
51+
matrix:
52+
php-version:
53+
- '7.2'
54+
55+
steps:
56+
-
57+
name: "Checkout code"
58+
uses: "actions/checkout@v2"
59+
60+
-
61+
name: "Install PHP"
62+
uses: "shivammathur/setup-php@v2"
63+
with:
64+
coverage: "none"
65+
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
66+
php-version: "${{ matrix.php-version }}"
67+
tools: composer:v2
68+
69+
-
70+
name: "Composer install"
71+
uses: "ramsey/composer-install@v1"
72+
with:
73+
composer-options: "--no-scripts"
74+
75+
-
76+
name: "Run friendsofphp/php-cs-fixer"
77+
run: "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose"
78+
79+
phpstan:
80+
needs:
81+
- "composer-validate"
82+
83+
name: "PHPStan (${{ matrix.php-version }})"
84+
85+
runs-on: "ubuntu-latest"
86+
87+
strategy:
88+
matrix:
89+
php-version:
90+
- '7.2'
91+
92+
steps:
93+
-
94+
name: "Checkout code"
95+
uses: "actions/checkout@v2"
96+
97+
-
98+
name: "Install PHP"
99+
uses: "shivammathur/setup-php@v2"
100+
with:
101+
coverage: "none"
102+
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
103+
php-version: "${{ matrix.php-version }}"
104+
tools: composer:v2
105+
106+
-
107+
name: "Composer install"
108+
uses: "ramsey/composer-install@v1"
109+
with:
110+
composer-options: "--no-scripts"
111+
112+
-
113+
name: "Run phpstan/phpstan"
114+
run: "vendor/bin/phpstan analyse -c phpstan.neon.dist"
115+
116+
tests:
117+
needs:
118+
- "composer-validate"
119+
120+
name: "PHP ${{ matrix.php-version }} + ${{ matrix.dependency }}"
121+
122+
runs-on: ubuntu-latest
123+
124+
continue-on-error: ${{ matrix.allow-failures }}
125+
126+
strategy:
127+
matrix:
128+
php-version:
129+
- '7.2'
130+
- '7.3'
131+
- '7.4'
132+
dependency:
133+
- 'lowest'
134+
- 'highest'
135+
with-examples: ['yes']
136+
allow-failures: [false]
137+
include:
138+
- php-version: '7.2'
139+
dependency: 'lowest'
140+
with-examples: 'no'
141+
allow-failures: false
142+
coverage: xdebug
143+
- php-version: '8.0'
144+
dependency: 'highest'
145+
with-examples: 'no'
146+
allow-failures: true
147+
coverage: xdebug
148+
149+
steps:
150+
- name: "Checkout code"
151+
uses: actions/checkout@v2.3.3
152+
153+
- name: "Install PHP with extensions"
154+
uses: shivammathur/setup-php@2.7.0
155+
with:
156+
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
157+
php-version: ${{ matrix.php-version }}
158+
tools: composer:v2
159+
160+
- name: "Add PHPUnit matcher"
161+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
162+
163+
- name: "Remove friendsofphp/php-cs-fixer"
164+
run: composer remove --dev friendsofphp/php-cs-fixer --no-update
165+
166+
- name: "Composer install"
167+
uses: "ramsey/composer-install@v1"
168+
with:
169+
dependency-versions: "${{ matrix.dependency }}"
170+
171+
- name: PHP Info
172+
run: php --version
173+
174+
- name: "Run tests with PHPUnit"
175+
run: vendor/bin/phpunit --verbose

0 commit comments

Comments
 (0)