Skip to content

Commit b2c8b18

Browse files
committed
ci: fix MSSQL service health check
Remove the sqlcmd health check since it's not available in the MSSQL Docker image. Instead, add a wait step that checks for port availability and gives the service time to fully initialize. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent cb0fa84 commit b2c8b18

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ jobs:
5151
MSSQL_PID: Developer
5252
ports:
5353
- 1433:1433
54-
options: >-
55-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'MySecretPassword1!' -Q 'SELECT 1' -C || exit 1"
56-
--health-interval 10s
57-
--health-timeout 5s
58-
--health-retries 10
59-
--health-start-period 30s
6054
steps:
6155
- uses: actions/checkout@v6
6256
- uses: actions/setup-go@v6
@@ -83,6 +77,19 @@ jobs:
8377
env:
8478
CGO_ENABLED: "0"
8579

80+
- name: Wait for databases to be ready
81+
run: |
82+
echo "Waiting for MSSQL..."
83+
for i in {1..60}; do
84+
if nc -z localhost 1433 2>/dev/null; then
85+
echo "MSSQL port is open, waiting for service to be ready..."
86+
sleep 10
87+
break
88+
fi
89+
echo "Waiting for MSSQL... ($i/60)"
90+
sleep 2
91+
done
92+
8693
- name: test ./...
8794
run: gotestsum --junitfile junit.xml -- --tags=examples -timeout 20m ./...
8895
if: ${{ matrix.os }} != "windows-2022"

0 commit comments

Comments
 (0)