-
Notifications
You must be signed in to change notification settings - Fork 138
129 lines (124 loc) · 5.22 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI
on: ["push", "pull_request"]
env:
COMPOSER_ALLOW_SUPERUSER: '1'
SYMFONY_PHPUNIT_VERSION: 9.6
SYMFONY_DEPRECATIONS_HELPER: max[self]=0
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
container:
image: php:8.3-alpine
options: >-
--tmpfs /tmp:exec
--tmpfs /var/tmp:exec
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-8.3-highest-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-8.3-highest
- name: Validate Composer
run: composer validate
- name: Install highest dependencies with Composer
run: composer update --no-progress --no-suggest --ansi
- name: Disable PHP memory limit
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
- name: Run CS-Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff --format=checkstyle
phpunit:
name: PHPUnit (PHP ${{ matrix.php }} Deps ${{ matrix.dependencies }})
runs-on: ubuntu-latest
container:
image: php:${{ matrix.php }}-alpine
options: >-
--tmpfs /tmp:exec
--tmpfs /var/tmp:exec
strategy:
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
dependencies:
- 'lowest'
- 'highest'
include:
- php: '8.1'
phpunit-version: 9.6
- php: '8.2'
phpunit-version: 9.6
- php: '8.3'
phpunit-version: 9.6
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.dependencies }}
- name: Install lowest dependencies with Composer
if: matrix.dependencies == 'lowest'
run: composer update --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
- name: Install highest dependencies with Composer
if: matrix.dependencies == 'highest'
run: composer update --no-progress --no-suggest --ansi
- name: Run tests with PHPUnit
env:
SYMFONY_MAX_PHPUNIT_VERSION: ${{ matrix.phpunit-version }}
run: vendor/bin/simple-phpunit --colors=always
coverage:
name: Coverage (PHP 8.3)
runs-on: ubuntu-latest
container:
image: php:8.3-alpine
options: >-
--tmpfs /tmp:exec
--tmpfs /var/tmp:exec
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pcov PHP extension
run: |
apk add $PHPIZE_DEPS
pecl install pcov
docker-php-ext-enable pcov
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-8.3-highest-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-8.3-highest
- name: Install highest dependencies with Composer
run: composer update --no-progress --no-suggest --ansi
- name: Run coverage with PHPUnit
run: vendor/bin/simple-phpunit --coverage-clover ./coverage.xml --colors=always
- name: Send code coverage report to Codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}