Skip to content

sqlserver

sqlserver #26

Workflow file for this run

name: sqlserver
on:
workflow_dispatch:
jobs:
mssql:
runs-on: ubuntu-20.04
services:
sqlsrv:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Forge123
ports:
- 1433:1433
strategy:
fail-fast: true
name: SQL Server 2019
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc, :php-psr
tools: composer:v2
coverage: none
- name: Set Framework version
run: composer config version "11.x-dev"
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
- name: Wait for SQL Server to be ready
run: |
echo "Waiting for SQL Server to start..."
for i in {1..30}; do
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Forge123 -Q "SELECT 1" && break
echo "SQL Server is starting up..."
sleep 2
done
- name: Execute tests
run: vendor/bin/phpunit
env:
DB_CONNECTION: sqlsrv
DB_HOST: localhost
DB_PORT: 1433
DB_DATABASE: master
DB_USERNAME: SA
DB_PASSWORD: Forge123