|
20 | 20 |
|
21 | 21 | jobs: |
22 | 22 | main: |
23 | | - name: PHP ${{ matrix.php-versions }} Unit Tests |
| 23 | + name: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }} |
24 | 24 | runs-on: ubuntu-latest |
25 | 25 | if: "!contains(github.event.head_commit.message, '[ci skip]')" |
26 | 26 | strategy: |
27 | 27 | matrix: |
28 | 28 | php-versions: ['7.4', '8.0', '8.1'] |
| 29 | + db-platforms: ['MySQLi', 'Postgre', 'SQLite3', 'SQLSRV', 'OCI8'] |
| 30 | + mysql-versions: [ '5.7' ] |
| 31 | + include: |
| 32 | + - php-versions: '7.4' |
| 33 | + db-platforms: MySQLi |
| 34 | + mysql-versions: '8.0' |
| 35 | + |
| 36 | + services: |
| 37 | + mysql: |
| 38 | + image: mysql:${{ matrix.mysql-versions }} |
| 39 | + env: |
| 40 | + MYSQL_ALLOW_EMPTY_PASSWORD: yes |
| 41 | + MYSQL_DATABASE: test |
| 42 | + ports: |
| 43 | + - 3306:3306 |
| 44 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 45 | + |
| 46 | + postgres: |
| 47 | + image: postgres |
| 48 | + env: |
| 49 | + POSTGRES_USER: postgres |
| 50 | + POSTGRES_PASSWORD: postgres |
| 51 | + POSTGRES_DB: test |
| 52 | + ports: |
| 53 | + - 5432:5432 |
| 54 | + options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 |
| 55 | + |
| 56 | + mssql: |
| 57 | + image: mcr.microsoft.com/mssql/server:2019-CU10-ubuntu-20.04 |
| 58 | + env: |
| 59 | + SA_PASSWORD: 1Secure*Password1 |
| 60 | + ACCEPT_EULA: Y |
| 61 | + MSSQL_PID: Developer |
| 62 | + ports: |
| 63 | + - 1433:1433 |
| 64 | + options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q 'SELECT @@VERSION'" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 65 | + |
| 66 | + oracle: |
| 67 | + image: quillbuilduser/oracle-18-xe |
| 68 | + env: |
| 69 | + ORACLE_ALLOW_REMOTE: true |
| 70 | + ports: |
| 71 | + - 1521:1521 |
| 72 | + options: --health-cmd="/opt/oracle/product/18c/dbhomeXE/bin/sqlplus -s sys/Oracle18@oracledbxe/XE as sysdba <<< 'SELECT 1 FROM DUAL'" --health-interval=10s --health-timeout=5s --health-retries=3 |
29 | 73 |
|
30 | 74 | steps: |
| 75 | + - name: Create database for MSSQL Server |
| 76 | + if: matrix.db-platforms == 'SQLSRV' |
| 77 | + run: sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test" |
| 78 | + |
| 79 | + - name: Install Oracle InstantClient |
| 80 | + if: matrix.db-platforms == 'OCI8' |
| 81 | + run: | |
| 82 | + sudo apt-get install wget libaio1 alien |
| 83 | + sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm |
| 84 | + sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm |
| 85 | + sudo wget https://download.oracle.com/otn_software/linux/instantclient/185000/oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm |
| 86 | + sudo alien oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm |
| 87 | + sudo alien oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm |
| 88 | + sudo alien oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm |
| 89 | + sudo dpkg -i oracle-instantclient18.5-basic_18.5.0.0.0-4_amd64.deb oracle-instantclient18.5-devel_18.5.0.0.0-4_amd64.deb oracle-instantclient18.5-sqlplus_18.5.0.0.0-4_amd64.deb |
| 90 | + echo "LD_LIBRARY_PATH=/lib/oracle/18.5/client64/lib/" >> $GITHUB_ENV |
| 91 | + echo "NLS_LANG=AMERICAN_AMERICA.UTF8" >> $GITHUB_ENV |
| 92 | + echo "C_INCLUDE_PATH=/usr/include/oracle/18.5/client64" >> $GITHUB_ENV |
| 93 | + echo 'NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV |
| 94 | + echo 'NLS_TIMESTAMP_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV |
| 95 | + echo 'NLS_TIMESTAMP_TZ_FORMAT=YYYY-MM-DD HH24:MI:SS' >> $GITHUB_ENV |
| 96 | +
|
| 97 | + - name: Create database for Oracle Database |
| 98 | + if: matrix.db-platforms == 'OCI8' |
| 99 | + run: echo -e "ALTER SESSION SET CONTAINER = XEPDB1;\nCREATE BIGFILE TABLESPACE \"TEST\" DATAFILE '/opt/oracle/product/18c/dbhomeXE/dbs/TEST' SIZE 10M AUTOEXTEND ON MAXSIZE UNLIMITED SEGMENT SPACE MANAGEMENT AUTO EXTENT MANAGEMENT LOCAL AUTOALLOCATE;\nCREATE USER \"ORACLE\" IDENTIFIED BY \"ORACLE\" DEFAULT TABLESPACE \"TEST\" TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON \"TEST\";\nGRANT CONNECT,RESOURCE TO \"ORACLE\";\nexit;" | /lib/oracle/18.5/client64/bin/sqlplus -s sys/Oracle18@localhost:1521/XE as sysdba |
| 100 | + |
31 | 101 | - name: Checkout |
32 | 102 | uses: actions/checkout@v3 |
33 | 103 |
|
|
36 | 106 | with: |
37 | 107 | php-version: ${{ matrix.php-versions }} |
38 | 108 | tools: composer, phive, phpunit |
39 | | - extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3 |
| 109 | + extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3, sqlsrv, oci8, pgsql |
40 | 110 | coverage: xdebug |
41 | 111 | env: |
42 | 112 | COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
63 | 133 | - name: Test with PHPUnit |
64 | 134 | run: vendor/bin/phpunit --verbose --coverage-text --testsuite main |
65 | 135 | env: |
| 136 | + DB: ${{ matrix.db-platforms }} |
66 | 137 | TERM: xterm-256color |
67 | 138 | TACHYCARDIA_MONITOR_GA: enabled |
68 | 139 |
|
|
75 | 146 | env: |
76 | 147 | COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
77 | 148 | COVERALLS_PARALLEL: true |
78 | | - COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }} |
| 149 | + COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }} |
79 | 150 |
|
80 | 151 | coveralls: |
81 | 152 | needs: [main] |
|
0 commit comments