-
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 2.03 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
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.2', '8.3', '8.4']
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: gd, mbstring, pcov, zip
ini-values: max_execution_time=600, memory_limit=-1
tools: composer:v2
coverage: pcov
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Composer dependencies
run: composer install --prefer-dist
- name: Test against highest versions
run: |
vendor/bin/unit-test
vendor/bin/functional-test
- name: Check code quality
run: vendor/bin/code-quality
env:
PHP_CS_FIXER_IGNORE_ENV: 1
- name: Test against lowest versions
run: |
composer update --prefer-lowest
vendor/bin/unit-test
vendor/bin/functional-test 5.4
- name: Archive logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: logs-php-${{ matrix.php-versions }}
path: vendor/endroid/quality/application/var/log
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-php-${{ matrix.php-versions }}
path: tests/coverage