1
1
name : CI
2
2
3
- on :
3
+ on :
4
4
push :
5
+ branches :
6
+ - master
5
7
pull_request :
8
+ types :
9
+ - opened
10
+ - reopened
11
+ - edited
12
+ - synchronize
13
+ - labeled
14
+ - assigned
15
+ - unlabeled
16
+ - unlocked
17
+ - review_requested
18
+ - review_request_removed
19
+ - unassigned
6
20
7
21
env :
8
22
COVERAGE : ' 1'
9
- php_extensions : ' apcu, bcmath, ctype, curl, dom, iconv, intl, json, mbstring, opcache, openssl, pdo, pdo_pgsql, pcntl, pcov, posix, redis, session, simplexml, sockets, tokenizer, xml, xmlwriter, zip'
23
+ php_extensions : ' apcu, bcmath, ctype, curl, dom, iconv, intl, json, mbstring, opcache, openssl, pdo, pdo_pgsql, pcntl, pcov, posix, redis, session, simplexml, sockets, tokenizer, xml, xmlwriter, zip, xdebug '
10
24
key : cache-v0.1
11
25
DB_USER : ' postgres'
12
- DB_NAME : ' testing '
26
+ DB_NAME : ' postgres '
13
27
DB_PASSWORD : ' postgres'
28
+ DB_HOST : ' 127.0.0.1'
14
29
15
- jobs :
30
+ jobs :
16
31
lint :
17
32
runs-on : ' ${{ matrix.operating_system }}'
18
- timeout-minutes : 20
19
- strategy :
33
+ timeout-minutes : 20
34
+ strategy :
20
35
matrix :
21
36
operating_system :
22
37
- ubuntu-latest
23
38
php_versions :
24
- - ' 7.4 '
39
+ - ' 8.3 '
25
40
fail-fast : false
26
- env :
41
+ env :
27
42
PHP_CS_FIXER_FUTURE_MODE : ' 0'
28
- name : ' Lint PHP'
29
- steps :
43
+ name : ' Linter PHP'
44
+ steps :
30
45
- name : ' Checkout'
31
46
uses : actions/checkout@v2
32
47
- name : ' Setup cache environment'
@@ -43,77 +58,42 @@ jobs:
43
58
key : ' ${{ steps.cache-env.outputs.key }}'
44
59
restore-keys : ' ${{ steps.cache-env.outputs.key }}'
45
60
- name : ' Setup PHP'
46
- uses : shivammathur/setup-php@v2
47
- with :
61
+ uses : shivammathur/setup-php@v2
62
+ with :
48
63
php-version : ${{ matrix.php_versions }}
49
64
extensions : ' ${{ env.php_extensions }}'
50
- ini-values : memory_limit=-1
65
+ ini-values : memory_limit=-1
51
66
tools : pecl, composer
52
67
coverage : none
53
68
- name : ' Setup problem matchers for PHP (aka PHP error logs)'
54
69
run : ' echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
55
70
- name : ' Setup problem matchers for PHPUnit'
56
71
run : ' echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"'
57
72
- name : ' Install PHP dependencies with Composer'
58
- run : |
59
- rm composer.lock
60
- composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
73
+ run : COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
61
74
working-directory : ' ./'
62
75
- name : ' Linting PHP source files'
63
- run : ' vendor/bin/ecs check --config=ecs.yml .'
76
+ run : ' vendor/bin/ecs check --config=ecs.php .'
64
77
test :
65
78
strategy :
66
79
fail-fast : false
67
80
matrix :
68
- exclude_group :
69
- - WithoutSchema,forPHP8
70
- experimental :
71
- - false
72
- operating_system :
73
- - ubuntu-latest
74
- postgres :
75
- - ' 10'
76
- - ' 11'
77
- - ' 12'
78
- php_versions :
79
- - ' 7.3'
80
- - ' 7.4'
81
+ coverage : [true]
82
+ experimental : [false]
83
+ operating_system : [ubuntu-latest]
84
+ postgres : ['10', '11', '12', '13', '14']
85
+ php_versions : ['8.3']
81
86
include :
82
87
- operating_system : ' ubuntu-latest'
83
- php_versions : ' 7.3'
84
- postgres : ' 9.6'
85
- experimental : false
86
- exclude_group : WithoutSchema,forPHP8
87
- - operating_system : ' ubuntu-latest'
88
- php_versions : ' 7.3'
89
- postgres : ' 13'
90
- experimental : false
91
- exclude_group : WithoutSchema,forPHP8
92
- - operating_system : ' ubuntu-latest'
93
- php_versions : ' 7.4'
94
- postgres : ' 13'
95
- experimental : false
96
- exclude_group : WithoutSchema,forPHP8
88
+ php_versions : ' 8.3'
89
+ postgres : ' 15'
90
+ coverage : false
91
+ experimental : true
97
92
- operating_system : ' ubuntu-latest'
98
- php_versions : ' 8.0'
99
- postgres : ' 10'
100
- experimental : false
101
- exclude_group : WithoutSchema,forPHP7
102
- - operating_system : ' ubuntu-latest'
103
- php_versions : ' 8.0'
104
- postgres : ' 11'
105
- experimental : false
106
- exclude_group : WithoutSchema,forPHP7
107
- - operating_system : ' ubuntu-latest'
108
- php_versions : ' 8.0'
109
- postgres : ' 12'
110
- experimental : false
111
- exclude_group : WithoutSchema,forPHP7
112
- - operating_system : ' ubuntu-latest'
113
- php_versions : ' 8.0'
114
- postgres : ' 13'
115
- experimental : false
116
- exclude_group : WithoutSchema,forPHP7
93
+ php_versions : ' 8.4'
94
+ postgres : ' 16'
95
+ coverage : false
96
+ experimental : true
117
97
runs-on : ' ${{ matrix.operating_system }}'
118
98
services :
119
99
postgres :
@@ -126,7 +106,7 @@ jobs:
126
106
- 5432:5432
127
107
# needed because the postgres container does not provide a healthcheck
128
108
options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
129
- name : ' Test / PHP ${{ matrix.php_versions }} / Postgres ${{ matrix.postgres }}'
109
+ name : ' Testing / PHP ${{ matrix.php_versions }} / Postgres ${{ matrix.postgres }}'
130
110
needs :
131
111
- lint
132
112
steps :
@@ -156,29 +136,30 @@ jobs:
156
136
with :
157
137
php-version : ${{ matrix.php_versions }}
158
138
extensions : ${{ env.php_extensions }}
159
- ini-values : ' pcov.directory=src, date.timezone=UTC, upload_max_filesize=20M, post_max_size=20M, memory_limit=512M, short_open_tag=Off'
160
- coverage : pcov
139
+ ini-values : ' date.timezone=UTC, upload_max_filesize=20M, post_max_size=20M, memory_limit=512M, short_open_tag=Off, xdebug.mode="develop,coverage" '
140
+ coverage : xdebug
161
141
tools : ' phpunit'
162
142
- name : ' Install PHP dependencies with Composer'
163
143
continue-on-error : ${{ matrix.experimental }}
164
- run : |
165
- rm composer.lock
166
- composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
144
+ run : COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
167
145
working-directory : ' ./'
168
146
- name : ' Run Unit Tests with PHPUnit'
169
147
continue-on-error : ${{ matrix.experimental }}
170
- env :
171
- # use localhost for the host here because we are running the job on the VM.
172
- # If we were running the job on in a container this would be postgres
173
- POSTGRES_USER : ${{ env.DB_USER }}
174
- POSTGRES_PASSWORD : ${{ env.DB_PASSWORD }}
175
- POSTGRES_DB : ${{ env.DB_NAME }}
176
- POSTGRES_HOST : 127.0.0.1
177
- POSTGRES_PORT : 5432
178
- run : ' ./vendor/bin/phpunit --verbose --stderr --configuration phpunit.github.xml --exclude-group ${{ matrix.exclude_group }} --coverage-clover build/logs/clover.xml --coverage-text'
148
+ run : |
149
+ php -v
150
+ sed -e "s/\${USERNAME}/${{ env.DB_USER }}/" \
151
+ -e "s/\${PASSWORD}/${{ env.DB_PASSWORD }}/" \
152
+ -e "s/\${DATABASE}/${{ env.DB_NAME }}/" \
153
+ -e "s/\${HOST}/${{ env.DB_HOST }}/" \
154
+ phpunit.xml.dist > phpunit.xml
155
+ ./vendor/bin/phpunit \
156
+ --stderr \
157
+ --coverage-clover build/logs/clover.xml \
158
+ --coverage-text
159
+ cat build/logs/clover.xml
179
160
working-directory : ' ./'
180
161
- name : Upload coverage results to Coveralls
181
- if : ${{ !matrix.experimental }}
162
+ if : ${{ !matrix.experimental && matrix.coverage }}
182
163
env :
183
164
COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
184
165
COVERALLS_PARALLEL : true
0 commit comments