Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/reusable-phpunit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ env:
jobs:
tests:
name: ${{ inputs.job-name }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Service containers cannot be extracted to caller workflows yet
services:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
--health-retries=3
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
image: mcr.microsoft.com/mssql/server:2025-CU2-ubuntu-24.04
env:
MSSQL_SA_PASSWORD: 1Secure*Password1
ACCEPT_EULA: Y
Expand Down Expand Up @@ -140,15 +140,32 @@ jobs:
- 11211:11211

steps:
- name: Install mssql-tools on runner
if: ${{ inputs.db-platform == 'SQLSRV' }}
run: |
# Detect Ubuntu version used by the runner (fallback to 24.04)
DISTRO=$(lsb_release -rs 2>/dev/null || echo '24.04')
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl -sSL https://packages.microsoft.com/config/ubuntu/${DISTRO}/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 mssql-tools18 unixodbc-dev
# Make sqlcmd available to subsequent steps
echo "/opt/mssql-tools18/bin" >> $GITHUB_PATH
- name: Create database for MSSQL Server
if: ${{ inputs.db-platform == 'SQLSRV' }}
run: sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test COLLATE Latin1_General_100_CS_AS_SC_UTF8"
run: |
sqlcmd -S 127.0.0.1 \
-U sa -P 1Secure*Password1 \
-N -C \
-Q "CREATE DATABASE test COLLATE Latin1_General_100_CS_AS_SC_UTF8"
- name: Install latest ImageMagick
if: ${{ contains(inputs.extra-extensions, 'imagick') }}
run: |
sudo apt-get update
sudo apt-get install --reinstall libgs9-common fonts-noto-mono libgs9:amd64 libijs-0.35:amd64 fonts-urw-base35 ghostscript poppler-data libjbig2dec0:amd64 libopenjp2-7:amd64 fonts-droid-fallback fonts-dejavu-core
sudo apt-get install --reinstall fonts-noto-mono libijs-0.35:amd64 fonts-urw-base35 ghostscript poppler-data libjbig2dec0:amd64 libopenjp2-7:amd64 fonts-droid-fallback fonts-dejavu-core
sudo apt-get install -y gsfonts libmagickwand-dev imagemagick
sudo apt-get install --fix-broken
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# in the caller workflow are not propagated to the called workflow.
coverage-php-version:
name: Setup PHP Version for Code Coverage
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.coverage-php-version.outputs.version }}
steps:
Expand Down
19 changes: 19 additions & 0 deletions system/Database/SQLSRV/Forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,25 @@ public function createDatabase(string $dbName, bool $ifNotExists = false): bool
}
}

/**
* {@inheritDoc}
*
* @see https://stackoverflow.com/questions/7469130/cannot-drop-database-because-it-is-currently-in-use
*/
public function dropDatabase(string $dbName): bool
{
try {
$this->db->query(sprintf(
'ALTER DATABASE %s SET SINGLE_USER WITH ROLLBACK IMMEDIATE',
$this->db->escapeIdentifier($dbName),
));
} catch (DatabaseException) {
// no-op
}

return parent::dropDatabase($dbName);
}

/**
* CREATE TABLE attributes
*/
Expand Down
Loading