-
-
Notifications
You must be signed in to change notification settings - Fork 46
86 lines (72 loc) · 2.54 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
tests:
name: "PHP ${{ matrix.php }} + Doctrine ORM ${{ matrix.doctrine-orm }} + Composer ${{ matrix.composer-flags }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '8.1'
- php: '8.2'
- php: '8.3'
- php: '8.4'
ignore-php-version: true
calculate-code-coverage: true
- doctrine-orm: '2.14'
- doctrine-orm: '3.0'
- doctrine-orm: 'latest'
steps:
- uses: actions/checkout@v4
- name: Set up PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php || '8.4' }}
coverage: xdebug
extensions: ctype, json, mbstring
tools: composer
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install composer dependencies
run: |
if [ "${{ matrix.doctrine-orm }}" == "2.14" ]; then
composer require doctrine/orm "~2.14" --prefer-dist --no-interaction --no-progress ${{ matrix.composer-flags }}
elif [ "${{ matrix.doctrine-orm }}" == "3.0" ]; then
composer require doctrine/orm "~3.0" --prefer-dist --no-interaction --no-progress ${{ matrix.composer-flags }}
else
composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer-flags }}
fi
- name: Run static analysis
run: composer run-static-analysis
continue-on-error: ${{ matrix.continue-on-error || false }}
- name: Check code style
run: composer check-code-style
if: matrix.ignore-php-version == true
env:
PHP_CS_FIXER_IGNORE_ENV: 1
- name: Check for security vulnerabilities in 3rd party dependencies
run: composer audit
- name: Run test suite
run: composer run-tests-with-clover
- name: Upload coverage results to Coveralls
if: matrix.calculate-code-coverage == true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }} + Composer@${{ matrix.composer-flags || '*' }}"
run: bin/php-coveralls -v --exclude-no-stmt