@@ -17,84 +17,11 @@ jobs:
1717
1818 name : PHP ${{ matrix.php }} tests
1919
20- services :
21- mysql57 :
22- image : mysql:5.7
23- env :
24- MYSQL_DATABASE : dibi_test
25- MYSQL_ROOT_PASSWORD : root
26- ports :
27- - 3306:3306
28- options : >-
29- --health-cmd "mysqladmin ping -ppass"
30- --health-interval 10s
31- --health-start-period 10s
32- --health-timeout 5s
33- --health-retries 10
34-
35- mysql80 :
36- image : mysql:8.0
37- ports :
38- - 3307:3306
39- options : >-
40- --health-cmd="mysqladmin ping -ppass"
41- --health-interval=10s
42- --health-timeout=5s
43- --health-retries=5
44- -e MYSQL_ROOT_PASSWORD=root
45- -e MYSQL_DATABASE=dibi_test
46-
47- postgres96 :
48- image : postgres:9.6
49- env :
50- POSTGRES_USER : postgres
51- POSTGRES_PASSWORD : postgres
52- POSTGRES_DB : dibi_test
53- ports :
54- - 5432:5432
55- options : >-
56- --health-cmd pg_isready
57- --health-interval 10s
58- --health-timeout 5s
59- --health-retries 5
60-
61- postgres13 :
62- image : postgres:13
63- env :
64- POSTGRES_USER : postgres
65- POSTGRES_PASSWORD : postgres
66- POSTGRES_DB : dibi_test
67- ports :
68- - 5433:5432
69- options : >-
70- --health-cmd pg_isready
71- --health-interval 10s
72- --health-timeout 5s
73- --health-retries 5
74-
75- mssql :
76- image : mcr.microsoft.com/mssql/server:latest
77- env :
78- ACCEPT_EULA : Y
79- SA_PASSWORD : YourStrong!Passw0rd
80- MSSQL_PID : Developer
81- ports :
82- - 1433:1433
83- options : >-
84- --name=mssql
85- --health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1' -N -C"
86- --health-interval 10s
87- --health-timeout 5s
88- --health-retries 5
89-
9020 steps :
9121 - uses : actions/checkout@v4
92- - uses : shivammathur/setup-php@v2
93- with :
94- php-version : ${{ matrix.php }}
95- extensions : ${{ env.php-extensions }}
96- tools : ${{ env.php-tools }}
97- coverage : none
22+
23+ - name : Start database containers
24+ run : docker compose up -d --wait --quiet-pull
9825
9926 - name : Install MS ODBC Driver for SQL Server
10027 run : |
@@ -117,13 +44,20 @@ jobs:
11744 sudo apt-get update
11845 sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
11946
120- # Create DB inside the MSSQL service container
121- docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd \
47+ # Create MS SQL database
48+ docker compose exec -T mssql /opt/mssql-tools18/bin/sqlcmd \
12249 -S localhost -U SA -P 'YourStrong!Passw0rd' \
12350 -Q "CREATE DATABASE dibi_test" -N -C
12451
52+ - uses : shivammathur/setup-php@v2
53+ with :
54+ php-version : ${{ matrix.php }}
55+ extensions : ${{ env.php-extensions }}
56+ tools : ${{ env.php-tools }}
57+ coverage : none
58+
12559 - name : Create databases.ini
126- run : cp ./tests/databases.github .ini ./tests/databases.ini
60+ run : cp ./tests/databases.docker .ini ./tests/databases.ini
12761
12862 - run : composer install --no-progress --prefer-dist
12963 - run : composer tester -- -p phpdbg --coverage ./coverage.xml --coverage-src ./src
0 commit comments