-
Notifications
You must be signed in to change notification settings - Fork 23
61 lines (50 loc) · 1.84 KB
/
ci.yml
File metadata and controls
61 lines (50 loc) · 1.84 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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: PHP ${{ matrix.php }}${{ matrix.prefer_lowest == '--prefer-lowest' && ' (lowest)' || '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
prefer_lowest: ['']
# --prefer-lowest only on PHP 7.4: the floor of every dependency
# lives at 7.4 (mockery 1.6, phpunit 9.6, console-diff-renderer 1.0),
# so a "lowest" run on PHP 8.x would install deps that don't actually
# support PHP 8 at runtime.
include:
- php: '7.4'
prefer_lowest: '--prefer-lowest'
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache Composer packages
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ matrix.php }}-${{ matrix.prefer_lowest }}-${{ hashFiles('composer.json') }}
restore-keys: |
composer-${{ matrix.php }}-
- name: Pin Composer platform to the runtime PHP version
run: composer config platform.php "$(php -r 'echo PHP_VERSION;')"
- name: Install dependencies
run: composer update --no-interaction --prefer-dist ${{ matrix.prefer_lowest }}
- name: Lint (phpcs)
if: matrix.prefer_lowest == ''
run: vendor/bin/phpcs --standard=./phpcs.xml.dist -p --warning-severity=0 src/ tests/
- name: Unit tests
run: vendor/bin/phpunit