File tree Expand file tree Collapse file tree 4 files changed +28
-24
lines changed Expand file tree Collapse file tree 4 files changed +28
-24
lines changed Original file line number Diff line number Diff line change 7
7
unit-tests :
8
8
runs-on : ubuntu-22.04
9
9
strategy :
10
- fail-fast : true
10
+ fail-fast : false
11
11
matrix :
12
+ image-tag-prefix : ["", "6.0-"]
12
13
php : ["8.1", "8.2", "8.3", "8.4"]
13
- swoole-prefix : ["6.0-", ""]
14
14
15
- name : Run Tests Using Image ${{ matrix.swoole -prefix }}php${{ matrix.php }}
15
+ name : Run Tests Using Image phpswoole/swoole: ${{ matrix.image-tag -prefix }}php${{ matrix.php }}
16
16
17
17
steps :
18
18
- name : Checkout
19
19
uses : actions/checkout@v4
20
20
21
- - name : Customize Dockerfile
22
- run : sed -i.bak -e "s/^FROM phpswoole\/swoole.*$/FROM phpswoole\/swoole:${{ matrix.swoole-prefix }}php${{ matrix.php }}/g" ./Dockerfile
23
-
24
21
- name : Start Docker Containers
25
22
uses : hoverkraft-tech/compose-action@v2.2.0
23
+ with :
24
+ up-flags : " --build --abort-on-container-exit --remove-orphans --renew-anon-volumes"
25
+ down-flags : " --volumes"
26
+ env :
27
+ IMAGE_TAG_PREFIX : ${{ matrix.image-tag-prefix }}
28
+ PHP_VERSION : ${{ matrix.php }}
26
29
27
30
- name : Prepare Test Environment
28
31
run : |
Original file line number Diff line number Diff line change 1
- FROM phpswoole/swoole
1
+ ARG IMAGE_TAG_PREFIX=""
2
+ ARG PHP_VERSION=8.3
3
+
4
+ FROM phpswoole/swoole:${IMAGE_TAG_PREFIX}php${PHP_VERSION}
2
5
3
6
RUN apt update \
4
7
&& apt install -y libaio-dev libc-ares-dev libaio1 supervisor wget git \
Original file line number Diff line number Diff line change 1
1
services :
2
2
app :
3
- build : .
3
+ build :
4
+ context : .
5
+ args :
6
+ - IMAGE_TAG_PREFIX
7
+ - PHP_VERSION
4
8
platform : linux/amd64
5
9
links :
6
10
- consul
@@ -21,12 +25,12 @@ services:
21
25
- wordpress:/var/www/html
22
26
23
27
php-fpm :
24
- image : php:8.3 -fpm
28
+ image : php:8.4 -fpm
25
29
volumes :
26
30
- .:/var/www
27
31
28
32
wordpress :
29
- image : wordpress:php8.3 -fpm
33
+ image : wordpress:php8.4 -fpm
30
34
links :
31
35
- mysql
32
36
environment :
@@ -43,36 +47,32 @@ services:
43
47
nocopy : false
44
48
45
49
mysql :
46
- image : mysql:8.2
50
+ image : mysql:8
47
51
environment :
48
52
MYSQL_DATABASE : test
49
53
MYSQL_USER : username
50
54
MYSQL_PASSWORD : password
51
55
MYSQL_ROOT_PASSWORD : password
52
56
53
57
pgsql :
54
- image : postgres:14
58
+ image : postgres:17-alpine
55
59
environment :
56
- POSTGRES_USER : root
57
60
POSTGRES_DB : test
58
- POSTGRES_PASSWORD : root
61
+ POSTGRES_USER : username
62
+ POSTGRES_PASSWORD : password
59
63
60
64
oracle :
61
65
image : gvenzl/oracle-xe:slim
62
66
platform : linux/amd64
63
67
environment :
64
68
ORACLE_PASSWORD : oracle
65
- ports :
66
- - 1521
67
69
68
70
redis :
69
- image : redis:6 .2
71
+ image : redis:7 .2
70
72
71
73
nacos :
72
74
image : nacos/nacos-server
73
75
platform : linux/amd64
74
- ports :
75
- - 8848
76
76
environment :
77
77
MODE : standalone
78
78
PREFER_HOST_MODE : hostname
@@ -81,8 +81,6 @@ services:
81
81
image : consul:1.15
82
82
command :
83
83
consul agent -dev -client=0.0.0.0
84
- ports :
85
- - 8500
86
84
87
85
volumes :
88
86
wordpress :
Original file line number Diff line number Diff line change 24
24
if (!defined ('MYSQL_SERVER_HOST ' )) {
25
25
define ('MYSQL_SERVER_HOST ' , 'mysql ' );
26
26
define ('MYSQL_SERVER_PORT ' , 3306 );
27
- define ('MYSQL_SERVER_USER ' , 'root ' );
27
+ define ('MYSQL_SERVER_USER ' , 'username ' );
28
28
define ('MYSQL_SERVER_PWD ' , 'password ' );
29
29
define ('MYSQL_SERVER_DB ' , 'test ' );
30
30
}
31
31
32
32
if (!defined ('PGSQL_SERVER_HOST ' )) {
33
33
define ('PGSQL_SERVER_HOST ' , 'pgsql ' );
34
34
define ('PGSQL_SERVER_PORT ' , 5432 );
35
- define ('PGSQL_SERVER_USER ' , 'root ' );
36
- define ('PGSQL_SERVER_PWD ' , 'root ' );
35
+ define ('PGSQL_SERVER_USER ' , 'username ' );
36
+ define ('PGSQL_SERVER_PWD ' , 'password ' );
37
37
define ('PGSQL_SERVER_DB ' , 'test ' );
38
38
}
39
39
You can’t perform that action at this time.
0 commit comments