Skip to content

Commit 8ac8c9d

Browse files
vkuttypCopilot
andcommitted
fix: use GitHub Secrets for MSSQL tests, drop service container
No need to spin up a local SQL Server container or install sqlcmd. Connect directly to the real server using repository secrets: MSSQL_TEST_HOST, MSSQL_TEST_PORT, MSSQL_TEST_DB, MSSQL_TEST_USER, MSSQL_TEST_PASS Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e52ea56 commit 8ac8c9d

1 file changed

Lines changed: 5 additions & 32 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -90,47 +90,20 @@ jobs:
9090
verify-mssql:
9191
name: Verify — SQL Server tests
9292
runs-on: ubuntu-24.04
93-
services:
94-
mssql:
95-
image: mcr.microsoft.com/mssql/server:2022-latest
96-
env:
97-
ACCEPT_EULA: "Y"
98-
SA_PASSWORD: "SuperStr0ngP@ssword!"
99-
MSSQL_PID: Developer
100-
ports: ["1433:1433"]
101-
options: >-
102-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'SuperStr0ngP@ssword!' -Q 'SELECT 1' -C"
103-
--health-interval 10s
104-
--health-retries 15
10593
steps:
10694
- uses: actions/checkout@v4
10795
- uses: swift-actions/setup-swift@v2
10896
with:
10997
swift-version: "6.0"
11098
- name: Install SQLite
11199
run: sudo apt-get install -y libsqlite3-dev
112-
- name: Install sqlcmd
113-
run: |
114-
curl -sSL https://github.com/microsoft/go-sqlcmd/releases/latest/download/sqlcmd-linux-amd64.tar.gz \
115-
| tar -xz -C /usr/local/bin sqlcmd
116-
- name: Create test database
117-
timeout-minutes: 3
118-
run: |
119-
for i in $(seq 1 30); do
120-
if sqlcmd -S 127.0.0.1 -U sa -P 'SuperStr0ngP@ssword!' -C \
121-
-Q "IF DB_ID('MSSQLNioTestDb') IS NULL CREATE DATABASE MSSQLNioTestDb" 2>/dev/null; then
122-
echo "Database ready."
123-
break
124-
fi
125-
echo "Attempt $i: SQL Server not ready yet, retrying in 5s..."
126-
sleep 5
127-
done
128100
- name: Run MSSQL tests
129101
env:
130-
MSSQL_TEST_HOST: "127.0.0.1"
131-
MSSQL_TEST_PASS: "SuperStr0ngP@ssword!"
132-
MSSQL_TEST_DB: MSSQLNioTestDb
133-
MSSQL_TEST_USER: sa
102+
MSSQL_TEST_HOST: ${{ secrets.MSSQL_TEST_HOST }}
103+
MSSQL_TEST_PORT: ${{ secrets.MSSQL_TEST_PORT }}
104+
MSSQL_TEST_DB: ${{ secrets.MSSQL_TEST_DB }}
105+
MSSQL_TEST_USER: ${{ secrets.MSSQL_TEST_USER }}
106+
MSSQL_TEST_PASS: ${{ secrets.MSSQL_TEST_PASS }}
134107
run: swift test --filter MSSQLNioTests
135108

136109
# ─────────────────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)