-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (54 loc) · 1.84 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
Build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: '7.4'
- php-version: '8.0'
- php-version: '8.1'
job-description: with lint
lint: true
- php-version: '8.2'
- php-version: '8.3'
composer-flags: '--ignore-platform-req=php'
name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ctype, mbstring
tools: cs2pr
- name: Get Composer's cache directory
id: composer-cache-path
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v3
id: composer-cache
with:
path: ${{ steps.composer-cache-path.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.composer-flags }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
env:
COMPOSER_ROOT_VERSION: "1.99.99"
run: composer install ${{ matrix.composer-flags }}
- name: Normalize composer.json
if: matrix.lint
run: composer normalize --dry-run
- name: PHP-CS-Fixer
if: matrix.lint
run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
# https://github.com/marketplace/actions/setup-php-action#phpunit
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: PHPUnit
run: vendor/bin/phpunit