test: Add test Groups #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: 📀 SQLServer | |
| on: # yamllint disable-line rule:truthy | |
| pull_request: | |
| branches: | |
| - 1.x | |
| push: | |
| branches: | |
| - 1.x | |
| jobs: | |
| acceptance: | |
| name: SQLServer · PHP ${{ matrix.php-version }} | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| cancel-in-progress: true | |
| group: mssql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - '8.4' | |
| - '8.5' | |
| steps: | |
| - name: 📦 Check out the codebase | |
| uses: actions/checkout@v6 | |
| - name: 🛠️ Install ODBC driver | |
| run: | | |
| curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list \ | |
| | sudo tee /etc/apt/sources.list.d/mssql-release.list | |
| sudo apt-get update | |
| sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 | |
| - name: 🛠️ Start SQLServer | |
| run: docker compose -f tests/docker-compose.yml up -d cycle-sqlserver | |
| - name: 🛠️ Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| tools: pecl | |
| extensions: pdo, pdo_sqlite, sqlsrv, pdo_sqlsrv | |
| ini-values: error_reporting=E_ALL | |
| - name: 📥 Install dependencies with composer | |
| uses: ramsey/composer-install@v3 | |
| env: | |
| COMPOSER_ROOT_VERSION: '1.x-dev' | |
| with: | |
| dependency-versions: highest | |
| - name: ⏳ Wait for SQLServer | |
| run: | | |
| for i in $(seq 1 30); do | |
| if docker exec $(docker ps -qf "ancestor=mcr.microsoft.com/mssql/server:2019-latest") \ | |
| /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1' -b; then | |
| echo "SQLServer is up"; exit 0 | |
| fi | |
| echo "Waiting for SQLServer... ($i)"; sleep 3 | |
| done | |
| echo "SQLServer did not become ready in time"; exit 1 | |
| - name: 🧪 Run acceptance tests (SQLServer) | |
| env: | |
| SQLSERVER_HOST: 127.0.0.1 | |
| SQLSERVER_PORT: 11433 | |
| SQLSERVER_USER: SA | |
| SQLSERVER_PASSWORD: 'YourStrong!Passw0rd' | |
| SQLSERVER_DATABASE: tempdb | |
| run: composer test:sqlserver |