-
-
Notifications
You must be signed in to change notification settings - Fork 196
65 lines (54 loc) · 1.87 KB
/
ci.yaml
File metadata and controls
65 lines (54 loc) · 1.87 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
name: "CI"
on:
pull_request:
push:
branches:
- '2.x'
jobs:
tests:
name: "PHP ${{ matrix.php }} ${{ matrix.mode }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '8.1'
composer: 2.1.x
phpunit: 10
- php: '8.2'
phpunit: 11
- php: '8.3'
- php: '8.4'
- php: '8.5'
mode: low-deps
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: ${{ matrix.php }}
tools: composer:${{ matrix.composer }}
- if: matrix.php == '8.1'
name: "Lint PHP files"
run: |
find src/ -name '*.php' | xargs -n1 php -l
find tests/ -name '*.php' | xargs -n1 php -l
- name: "Validate composer.json"
run: "composer validate --strict --no-check-lock"
- name: "Install dependencies"
run: |
if [[ -n "${{ matrix.phpunit }}" ]]; then
composer r --dev --no-update phpunit/phpunit:^${{ matrix.phpunit }} --ansi
fi
if [[ "${{ matrix.phpunit }}" = 10 ]]; then
sed -i 's/ *ignoreIndirectDeprecations="true"//g' phpunit.xml.dist
fi
if [[ "${{ matrix.mode }}" = low-deps ]]; then
composer u --prefer-lowest --prefer-stable --ansi
else
composer u --ansi
fi
- name: "Run tests"
run: vendor/bin/phpunit