18
18
- ' phpunit*'
19
19
- ' .github/workflows/phpunit.yml'
20
20
21
+ concurrency :
22
+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
23
+ cancel-in-progress : true
24
+
25
+ permissions :
26
+ contents : read
27
+
28
+ env :
29
+ NLS_LANG : ' AMERICAN_AMERICA.UTF8'
30
+ NLS_DATE_FORMAT : ' YYYY-MM-DD HH24:MI:SS'
31
+ NLS_TIMESTAMP_FORMAT : ' YYYY-MM-DD HH24:MI:SS'
32
+ NLS_TIMESTAMP_TZ_FORMAT : ' YYYY-MM-DD HH24:MI:SS'
33
+
21
34
jobs :
22
35
main :
23
- name : PHP ${{ matrix.php-versions }} Unit Tests
36
+ name : PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
24
37
runs-on : ubuntu-22.04
38
+ if : " !contains(github.event.head_commit.message, '[ci skip]')"
39
+ strategy :
40
+ matrix :
41
+ php-versions : ['8.1', '8.2', '8.3']
42
+ db-platforms : ['MySQLi', 'SQLite3']
43
+ include :
44
+ # Postgre
45
+ - php-versions : ' 8.1'
46
+ db-platforms : Postgre
47
+ # SQLSRV
48
+ - php-versions : ' 8.1'
49
+ db-platforms : SQLSRV
50
+ # OCI8
51
+ - php-versions : ' 8.1'
52
+ db-platforms : OCI8
25
53
26
54
services :
55
+ mysql :
56
+ image : mysql:8.0
57
+ env :
58
+ MYSQL_ALLOW_EMPTY_PASSWORD : yes
59
+ MYSQL_DATABASE : test
60
+ ports :
61
+ - 3306:3306
62
+ options : >-
63
+ --health-cmd="mysqladmin ping"
64
+ --health-interval=10s
65
+ --health-timeout=5s
66
+ --health-retries=3
67
+
68
+ postgres :
69
+ image : postgres
70
+ env :
71
+ POSTGRES_USER : postgres
72
+ POSTGRES_PASSWORD : postgres
73
+ POSTGRES_DB : test
74
+ ports :
75
+ - 5432:5432
76
+ options : >-
77
+ --health-cmd=pg_isready
78
+ --health-interval=10s
79
+ --health-timeout=5s
80
+ --health-retries=3
81
+
82
+ mssql :
83
+ image : mcr.microsoft.com/mssql/server:2022-latest
84
+ env :
85
+ MSSQL_SA_PASSWORD : 1Secure*Password1
86
+ ACCEPT_EULA : Y
87
+ MSSQL_PID : Developer
88
+ ports :
89
+ - 1433:1433
90
+ options : >-
91
+ --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q 'SELECT @@VERSION'"
92
+ --health-interval=10s
93
+ --health-timeout=5s
94
+ --health-retries=3
95
+
96
+ oracle :
97
+ image : gvenzl/oracle-xe:21
98
+ env :
99
+ ORACLE_RANDOM_PASSWORD : true
100
+ APP_USER : ORACLE
101
+ APP_USER_PASSWORD : ORACLE
102
+ ports :
103
+ - 1521:1521
104
+ options : >-
105
+ --health-cmd healthcheck.sh
106
+ --health-interval 20s
107
+ --health-timeout 10s
108
+ --health-retries 10
109
+
27
110
redis :
28
111
image : redis
29
112
ports :
@@ -34,12 +117,27 @@ jobs:
34
117
--health-timeout=5s
35
118
--health-retries=3
36
119
37
- if : " !contains(github.event.head_commit.message, '[ci skip]')"
38
- strategy :
39
- matrix :
40
- php-versions : ['8.1', '8.2', '8.3']
41
-
42
120
steps :
121
+ - name : Free Disk Space (Ubuntu)
122
+ uses : jlumbroso/free-disk-space@main
123
+ with :
124
+ # this might remove tools that are actually needed,
125
+ # if set to "true" but frees about 6 GB
126
+ tool-cache : false
127
+
128
+ # all of these default to true, but feel free to set to
129
+ # "false" if necessary for your workflow
130
+ android : true
131
+ dotnet : true
132
+ haskell : true
133
+ large-packages : false
134
+ docker-images : true
135
+ swap-storage : true
136
+
137
+ - name : Create database for MSSQL Server
138
+ if : matrix.db-platforms == 'SQLSRV'
139
+ run : sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test"
140
+
43
141
- name : Checkout
44
142
uses : actions/checkout@v4
45
143
48
146
with :
49
147
php-version : ${{ matrix.php-versions }}
50
148
tools : composer, phive, phpunit
51
- extensions : intl, json, mbstring, gd, xdebug, xml, sqlite3, redis
149
+ extensions : intl, json, mbstring, gd, xdebug, xml, sqlite3, sqlsrv, oci8, pgsql
52
150
coverage : xdebug
53
151
env :
54
152
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74
172
- name : Test with PHPUnit
75
173
run : vendor/bin/phpunit --coverage-text
76
174
env :
175
+ DB : ${{ matrix.db-platforms }}
77
176
TERM : xterm-256color
78
177
TACHYCARDIA_MONITOR_GA : enabled
79
178
86
185
env :
87
186
COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88
187
COVERALLS_PARALLEL : true
89
- COVERALLS_FLAG_NAME : PHP ${{ matrix.php-versions }}
188
+ COVERALLS_FLAG_NAME : PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
90
189
91
190
coveralls :
92
191
needs : [main]
0 commit comments