Skip to content

Commit

Permalink
Support PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Nov 25, 2020
1 parent 6228c30 commit 3e7f2c2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ jobs:

strategy:
matrix:
php: [7.4, 7.3]
php: [8.0, 7.4, 7.3]
database: [mysql, pgsql, sqlite, sqlsrv]
release: [stable, lowest]
include:
- php: 7.4
release: stable
coverage: xdebug
- database: sqlsrv
pdo_suffix: -5.9.0preview1

services:
mysql:
Expand All @@ -32,6 +34,16 @@ jobs:
POSTGRES_DB: test
ports:
- 5432/tcp
sqlsrv:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Password!
options: >-
--name sqlsrv
--health-cmd "echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P Password!"
ports:
- 1433

steps:
- uses: actions/checkout@v2
Expand All @@ -43,23 +55,13 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl
extensions: bcmath, ctype, json, mbstring, openssl, pdo, pdo_${{ matrix.database }}, tokenizer, xml
extensions: bcmath, ctype, json, mbstring, openssl, pdo, pdo_${{ matrix.database }}${{ matrix.pdo_suffix }}, tokenizer, xml
coverage: ${{ matrix.coverage }}
- run: |
mysql -h 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -u root -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'"
mysql -h 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -u root -ppassword -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'"
if: matrix.database == 'mysql' && matrix.php < 7.4
- run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/mssql-server-2017.list
sudo apt-get update
sudo apt-get install mssql-server=14.0.3192.2-2
sudo MSSQL_SA_PASSWORD=Password! MSSQL_PID=developer /opt/mssql/bin/mssql-conf -n setup accept-eula
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install mssql-tools unixodbc-dev
sudo /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Password! -Q "create database [test]"
- run: docker exec sqlsrv /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P Password! -Q "create database [test]"
if: matrix.database == 'sqlsrv'
- run: composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-${{ matrix.release }}
- run: cp tests/config/database.ci.php tests/config/database.php
Expand All @@ -70,6 +72,7 @@ jobs:
DATABASE: ${{ matrix.database }}
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
PGSQL_PORT: ${{ job.services.pgsql.ports[5432] }}
SQLSRV_PORT: ${{ job.services.sqlsrv.ports[1433] }}
- run: |
wget -q https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"illuminate/database": "^8.0",
"staudenmeir/laravel-cte": "^1.4"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/config/database.ci.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => '127.0.0.1',
'port' => '1433',
'port' => getenv('SQLSRV_PORT'),
'database' => 'test',
'username' => 'sa',
'password' => 'Password!',
Expand Down

0 comments on commit 3e7f2c2

Please sign in to comment.