-
Notifications
You must be signed in to change notification settings - Fork 163
62 lines (51 loc) · 1.92 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
name: Continuous Integration
on:
pull_request:
push:
branches:
- "2.x"
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{ matrix.php-version }}
- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: 'echo "::set-output name=directory::$(composer config cache-dir)"'
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v4.0.2"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-cache"
- name: "Install lowest available packages for PHP 7.4, 8.0 and 8.1"
if: ${{ matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1' }}
run: "composer up --prefer-lowest"
- name: "Install packages for PHP 8.4"
if: ${{ matrix.php-version == '8.4' }}
run: "composer install --ignore-platform-reqs"
- name: "Run tests (old PHP versions)"
if: ${{ matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1' }}
run: "PHPUNIT_FLAGS=--no-coverage make test-phpunit test-psalm test-examples"
- name: "Run tests"
if: ${{ matrix.php-version == '8.2' || matrix.php-version == '8.3' }}
run: "make -j -O test"
- name: "Run tests (PHP 8.4)"
if: ${{ matrix.php-version == '8.4' }}
run: "make -j -O test-phpunit test-examples"
- name: "Send code coverage"
if: ${{ matrix.php-version == '8.3' }}
uses: codecov/codecov-action@v4.6.0