Skip to content

Commit d1475b1

Browse files
committed
Simplify MSSQL database setup using docker exec
Instead of installing sqlcmd tools on the runner, use docker exec to run sqlcmd from within the container itself. This is much simpler and faster.
1 parent c3b8486 commit d1475b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/example.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ jobs:
128128
with:
129129
fetch-depth: 0
130130

131+
- name: Create MSSQL database
132+
run: |
133+
docker exec $(docker ps -q -f "ancestor=mcr.microsoft.com/mssql/server:2022-latest") \
134+
/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P "Passw0rd" -Q "CREATE DATABASE testdb;" -C
135+
131136
- name: Preview MSSQL schema changes
132137
uses: ./
133138
with:

0 commit comments

Comments
 (0)