-
Notifications
You must be signed in to change notification settings - Fork 8
174 lines (164 loc) · 6.14 KB
/
Copy pathci.yml
File metadata and controls
174 lines (164 loc) · 6.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: CI
on:
pull_request:
push:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
ci:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}-${{ matrix.sqlserver.label }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
sqlserver:
- label: 'SQL Server 2025'
version: '2025'
- label: 'SQL Server 2022'
version: '2022'
- label: 'SQL Server 2019'
version: '2019'
include:
- os: windows-latest
name: Windows
- os: ubuntu-latest
name: Linux
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup WSL
uses: Particular/setup-wsl-action@v1.2.0
- name: Run
uses: ./
with:
connection-string-env-var: SQL_CONN_STR
catalog: my-test-catalog
sqlserver-version: ${{ matrix.sqlserver.version }}
- name: Check result
shell: pwsh
run: |
$connstr = $Env:SQL_CONN_STR
Write-Host "Connection String: $connstr"
$result = sqlcmd -Q "SELECT DB_NAME() as CatalogName" -d "my-test-catalog"
echo $result
ci-full-text-search:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}-${{ matrix.sqlserver.label }}-FTS
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
sqlserver:
- label: 'SQL Server 2025'
version: '2025'
- label: 'SQL Server 2022'
version: '2022'
- label: 'SQL Server 2019'
version: '2019'
include:
- os: windows-latest
name: Windows
- os: ubuntu-latest
name: Linux
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup WSL
uses: Particular/setup-wsl-action@v1.2.0
- name: Run with FTS
uses: ./
with:
connection-string-env-var: SQL_CONN_STR
catalog: my-test-catalog
sqlserver-version: ${{ matrix.sqlserver.version }}
enable-full-text-search: "true"
- name: Check FTS result
shell: pwsh
run: |
$connstr = $Env:SQL_CONN_STR
Write-Host "Connection String: $connstr"
sqlcmd -b -Q "IF FULLTEXTSERVICEPROPERTY('IsFullTextInstalled') <> 1 THROW 50001, 'Full-Text Search is not installed.', 1;"
# FTS check as a one-liner -Q: the Windows sqlcmd wrapper is a .cmd shim (no multi-line
# args), and the Linux wrapper forwards to the in-container sqlcmd, which can't read
# host-side files. `sqlcmd -i <file>` and multi-line args are both out.
sqlcmd -b -Q "USE [my-test-catalog]; CREATE TABLE dbo.FullTextSmoke (Id INT NOT NULL, Content NVARCHAR(200) NOT NULL); CREATE UNIQUE INDEX UX_FullTextSmoke_Id ON dbo.FullTextSmoke(Id); CREATE FULLTEXT CATALOG SmokeCatalog AS DEFAULT; CREATE FULLTEXT INDEX ON dbo.FullTextSmoke(Content LANGUAGE 1033) KEY INDEX UX_FullTextSmoke_Id;"
ci-distributed-transactions:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}-${{ matrix.sqlserver.label }}-DTC
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
sqlserver:
- label: 'SQL Server 2022'
version: '2022'
- label: 'SQL Server 2025'
version: '2025'
include:
- os: windows-latest
name: Windows
- os: ubuntu-latest
name: Linux
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup WSL
uses: Particular/setup-wsl-action@v1.2.0
- name: Run with distributed transactions
uses: ./
with:
connection-string-env-var: SQL_CONN_STR
catalog: my-test-catalog
sqlserver-version: ${{ matrix.sqlserver.version }}
enable-distributed-transactions: "true"
- name: Verify DTC configuration
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
# Mirror the action's distribution resolution so the inspect commands reach the right WSL.
$distribution = $Env:WSL_DISTRIBUTION
if ($Env:RUNNER_OS -eq 'Windows') {
$envJson = (& wsl.exe --distribution $distribution -- docker inspect sqlserver --format '{{json .Config.Env}}') -join "`n"
$portOut = (& wsl.exe --distribution $distribution -- docker port sqlserver) -join "`n"
} else {
$envJson = docker inspect sqlserver --format '{{json .Config.Env}}'
$portOut = docker port sqlserver
}
Write-Host "Container env:"
Write-Host $envJson
Write-Host "Published ports:"
Write-Host $portOut
if ($envJson -notmatch 'MSSQL_RPC_PORT=13500') {
throw "MSSQL_RPC_PORT=13500 is not configured in the container."
}
if ($envJson -notmatch 'MSSQL_DTC_TCP_PORT=51000') {
throw "MSSQL_DTC_TCP_PORT=51000 is not configured in the container."
}
# docker port lists "<container port>/tcp -> <host ip>:<host port>".
$portLines = ($portOut -split "`n") | ForEach-Object { $_.Trim() }
if (-not ($portLines | Where-Object { $_ -match '-> .*:135$' })) {
throw "RPC host port 135 is not published."
}
if (-not ($portLines | Where-Object { $_ -match '-> .*:51000$' })) {
throw "MSDTC host port 51000 is not published."
}
Write-Host "Distributed transaction (MSDTC) configuration verified."
- name: Check result
shell: pwsh
run: |
$connstr = $Env:SQL_CONN_STR
Write-Host "Connection String: $connstr"
$result = sqlcmd -Q "SELECT DB_NAME() as CatalogName" -d "my-test-catalog"
echo $result
- name: Setup .NET SDK
if: runner.os == 'Windows'
uses: actions/setup-dotnet@v6.0.0
with:
dotnet-version: 10.0.x
- name: Run DTC functional test
if: runner.os == 'Windows'
run: dotnet test src/tests/Tests.csproj --configuration Release --logger "GitHubActions"