|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | tests: |
11 | | - runs-on: ubuntu-latest |
| 11 | + runs-on: ubuntu-22.04 |
12 | 12 | strategy: |
13 | 13 | matrix: |
14 | 14 | php: ['8.2', '8.3', '8.4', '8.5'] |
@@ -96,12 +96,35 @@ jobs: |
96 | 96 | tools: ${{ env.php-tools }} |
97 | 97 | coverage: none |
98 | 98 |
|
| 99 | + - name: Install MS ODBC Driver for SQL Server |
| 100 | + run: | |
| 101 | + set -euxo pipefail |
| 102 | +
|
| 103 | + sudo apt-get update |
| 104 | + sudo apt-get install -y curl ca-certificates gnupg |
| 105 | +
|
| 106 | + # Microsoft apt repo key (non-interactive; fixes "gpg: cannot open /dev/tty") |
| 107 | + sudo install -d -m 0755 /etc/apt/keyrings |
| 108 | + curl -fsSL https://packages.microsoft.com/keys/microsoft.asc \ |
| 109 | + | sudo gpg --dearmor --batch --yes --no-tty -o /etc/apt/keyrings/microsoft.gpg |
| 110 | + sudo chmod a+r /etc/apt/keyrings/microsoft.gpg |
| 111 | +
|
| 112 | + # Microsoft apt repo for current Ubuntu runner |
| 113 | + . /etc/os-release |
| 114 | + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/ubuntu/${VERSION_ID}/prod ${VERSION_CODENAME} main" \ |
| 115 | + | sudo tee /etc/apt/sources.list.d/microsoft-prod.list > /dev/null |
| 116 | +
|
| 117 | + sudo apt-get update |
| 118 | + sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 |
| 119 | +
|
| 120 | + # Create DB inside the MSSQL service container |
| 121 | + docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd \ |
| 122 | + -S localhost -U SA -P 'YourStrong!Passw0rd' \ |
| 123 | + -Q "CREATE DATABASE dibi_test" -N -C |
| 124 | +
|
99 | 125 | - name: Create databases.ini |
100 | 126 | run: cp ./tests/databases.github.ini ./tests/databases.ini |
101 | 127 |
|
102 | | - - name: Create MS SQL Database |
103 | | - run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE dibi_test' -N -C |
104 | | - |
105 | 128 | - run: composer install --no-progress --prefer-dist |
106 | 129 | - run: composer tester -- -p phpdbg --coverage ./coverage.xml --coverage-src ./src |
107 | 130 | - if: failure() |
|
0 commit comments