@@ -22,6 +22,48 @@ build:
2222
2323 phpunit :
2424 services :
25+ db-mssql :
26+ image : mcr.microsoft.com/mssql/server:2017-latest
27+
28+ # Define any additional environment variables that are needed by the service.
29+ env :
30+ SA_PASSWORD : YourStrong!Passw0rd
31+ ACCEPT_EULA : Y
32+ MSSQL_PID : Developer
33+
34+ # We automatically forward these ports from your localhost to the service's port.
35+ # Alternatively, you can also access the service on the "$SERVICE_SOME_NAME_IP"
36+ # environment variable.
37+ ports :
38+ # Forward 127.0.0.1:12345 -> SERVICE_IP:12345
39+ - 1433
40+
41+ # If your service writes data to disk like most databases do, you can significantly
42+ # speed up tests by mounting a ramdisk at those paths.
43+ ramdisks :
44+ - /var/lib/data
45+
46+ db-mysql :
47+ image : mysql:8.0.29
48+
49+ # Define any additional environment variables that are needed by the service.
50+ env :
51+ MYSQL_ALLOW_EMPTY_PASSWORD : 1
52+ MYSQL_ROOT_PASSWORD : ' '
53+ MYSQL_DATABASE : yiitest
54+
55+ # We automatically forward these ports from your localhost to the service's port.
56+ # Alternatively, you can also access the service on the "$SERVICE_SOME_NAME_IP"
57+ # environment variable.
58+ ports :
59+ # Forward 127.0.0.1:12345 -> SERVICE_IP:12345
60+ - 3306
61+
62+ # If your service writes data to disk like most databases do, you can significantly
63+ # speed up tests by mounting a ramdisk at those paths.
64+ ramdisks :
65+ - /var/lib/data
66+
2567 db-pgsql :
2668 image : postgres:14
2769
@@ -43,13 +85,67 @@ build:
4385 ramdisks :
4486 - /var/lib/data
4587
46- dependencies :
47- override :
48- - composer require yiisoft/db-pgsql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
88+ db-oracle :
89+ image : wnameless/oracle-xe-11g-r2:latest
90+
91+ # We automatically forward these ports from your localhost to the service's port.
92+ # Alternatively, you can also access the service on the "$SERVICE_SOME_NAME_IP"
93+ # environment variable.
94+ ports :
95+ # Forward 127.0.0.1:12345 -> SERVICE_IP:12345
96+ - 1521
97+
98+ # If your service writes data to disk like most databases do, you can significantly
99+ # speed up tests by mounting a ramdisk at those paths.
100+ ramdisks :
101+ - /var/lib/data
49102
50103 tests :
104+ before :
105+ - curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
106+ - curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
107+ - sudo apt-get update -y
108+ - sudo ACCEPT_EULA=Y apt-get install mssql-tools unixodbc-dev -y
109+ - sudo ls /opt/mssql-tools/bin/sqlcmd*
110+ - /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'
111+ - pecl -q install pdo_sqlsrv
112+ - sudo mkdir -p /opt/oracle
113+ - sudo curl -k -L --output /opt/oracle/instantclient-basic-linux.x64-21.3.0.0.0.zip https://download.oracle.com/otn_software/linux/instantclient/213000/instantclient-basic-linux.x64-21.3.0.0.0.zip
114+ - sudo curl -k -L --output /opt/oracle/instantclient-sdk-linux.x64-21.3.0.0.0.zip https://download.oracle.com/otn_software/linux/instantclient/213000/instantclient-sdk-linux.x64-21.3.0.0.0.zip
115+ - sudo unzip /opt/oracle/instantclient-basic-linux.x64-21.3.0.0.0.zip -d /opt/oracle
116+ - sudo unzip /opt/oracle/instantclient-sdk-linux.x64-21.3.0.0.0.zip -d /opt/oracle
117+ - sudo apt-get install libaio1 -y
118+ - export ORACLE_HOME=/opt/oracle/instantclient_21_3
119+ - sudo sh -c "echo /opt/oracle/instantclient_21_3 > /etc/ld.so.conf.d/oracle-instantclient.conf"
120+ - sudo ldconfig
121+ - curl -k -L --output /home/scrutinizer/oci8-3.0.1.tgz https://pecl.php.net/get/oci8-3.0.1.tgz
122+ - cd /home/scrutinizer
123+ - tar -zxf oci8-3.0.1.tgz
124+ - cd oci8-3.0.1
125+ - phpize
126+ - ./configure --with-oci8=instantclient,/opt/oracle/instantclient_21_3
127+ - make
128+ - sudo make install
129+ - sudo ldconfig
130+ - curl -k -L --output /home/scrutinizer/php-8.0.20.tar.gz https://www.php.net/distributions/php-8.0.20.tar.gz
131+ - cd /home/scrutinizer
132+ - tar -zxf php-8.0.20.tar.gz
133+ - cd php-8.0.20/ext/pdo_oci
134+ - phpize
135+ - ./configure --with-pdo-oci=instantclient,/opt/oracle/instantclient_21_3
136+ - make
137+ - sudo make install
138+ - sudo ldconfig
139+ - cd /home/scrutinizer/build/
140+ - composer require yiisoft/db-mssql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
141+ - composer require yiisoft/db-mysql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
142+ - composer require yiisoft/db-oracle --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
143+ - composer require yiisoft/db-pgsql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
144+ - composer require yiisoft/db-sqlite --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
145+ - echo 'extension=pdo_oci' >> /home/scrutinizer/.phpenv/versions/8.0.20/etc/php.ini
146+
51147 override :
52- - command : ./vendor/bin/phpunit --group Pgsql -- coverage-clover ./coverage.xml
148+ - command : ./vendor/bin/phpunit --coverage-clover ./coverage.xml
53149 coverage :
54150 file : coverage.xml
55151 format : php-clover
0 commit comments