Skip to content

Commit

Permalink
Merge pull request #293 from Lombiq/issue/OSOE-481
Browse files Browse the repository at this point in the history
OSOE-481: Action pulls latest SQL Server (=2022-latest) but 2019-latest is used in Lombiq.GitHub.Actions
  • Loading branch information
dministro authored Dec 31, 2023
2 parents e97046f + 44f0be8 commit d209575
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
17 changes: 12 additions & 5 deletions .github/actions/setup-sql-server/Initialize-SqlServer.ps1
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
param (
[string]$sqlServerVersion = '2022'
)

if ($Env:RUNNER_OS -eq 'Windows')
{
choco install sql-server-express --no-progress
choco install sql-server-$sqlServerVersion --no-progress
}
else
{
$containerName = 'uitt-sqlserver'
$sqlServerLink = "mcr.microsoft.com/mssql/server:${sqlServerVersion}-latest"

$dockerRunSwitches = @(
'--name', 'sql2019'
'--name', $containerName
'--env', 'ACCEPT_EULA=Y'
'--env', 'SA_PASSWORD=Password1!'
'--publish', '1433:1433'
'--detach', 'mcr.microsoft.com/mssql/server:2019-latest'
'--detach', $sqlServerLink
)

docker pull mcr.microsoft.com/mssql/server &&
docker pull $sqlServerLink &&
docker run @dockerRunSwitches &&
docker exec --user 0 sql2019 bash -c 'mkdir /data; chmod 777 /data --recursive; chown mssql:root /data'
docker exec --user 0 $containerName bash -c 'mkdir /data; chmod 777 /data --recursive; chown mssql:root /data'
}
2 changes: 1 addition & 1 deletion .github/actions/setup-sql-server/Wait-SqlServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ for ($i = 1; $i -le $maxTryCount; $i++)

if ($Env:RUNNER_OS -eq 'Windows')
{
sqlcmd -b -S .\SQLEXPRESS -Q 'SELECT @@SERVERNAME as ServerName' 2>&1>$null
sqlcmd -b -Q 'SELECT @@SERVERNAME as ServerName' 2>&1>$null
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/test-dotnet/Invoke-SolutionTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ $connectionStringSuffix = @(
) -join ''
if ($Env:RUNNER_OS -eq 'Windows')
{
$connectionStringStem = 'Server=.\SQLEXPRESS;Database=LombiqUITestingToolbox_{{id}};Integrated Security=True'
$connectionStringStem = 'Server=.;Database=LombiqUITestingToolbox_{{id}};Integrated Security=True'
}
else
{
$connectionStringStem = 'Server=.;Database=LombiqUITestingToolbox_{{id}};User Id=sa;Password=Password1!'

$Env:Lombiq_Tests_UI__DockerConfiguration__ContainerName = 'sql2019'
$Env:Lombiq_Tests_UI__DockerConfiguration__ContainerName = 'uitt-sqlserver'
}

$Env:Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate = $connectionStringStem + $connectionStringSuffix
Expand Down

0 comments on commit d209575

Please sign in to comment.