Skip to content

Commit d25545b

Browse files
committed
CI(MSSQL): Enable TCP for MSSQL
1 parent 945f696 commit d25545b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/run-tests.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ jobs:
4646
sudo apt-get install --yes freetds-bin
4747
echo "SELECT @@VERSION" | tsql -H localhost -p 1433 -U sa -P 'YourStrong!Passw0rd'
4848
if: ${{ runner.os == 'Linux' }}
49+
- name: Enable TCP for MSSQL
50+
run: |
51+
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SqlWmiManagement')
52+
$wmi = New-Object 'Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer' localhost
53+
$tcp = $wmi.ServerInstances['MSSQLSERVER'].ServerProtocols['Tcp']
54+
$tcp.IsEnabled = $true
55+
$tcp.Alter()
56+
Restart-Service -Name MSSQLSERVER -Force
57+
shell: powershell
58+
if: ${{ runner.os == 'Windows' }}
4959

5060
# Setup Python/pip
5161
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)