From 87b9b8d91a65dc8605ccc9ba1d08c6fa92200ee7 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Fri, 26 Sep 2025 20:36:30 +0900 Subject: [PATCH 1/3] make MSSQL setup simpler From c3b8486ea0587c1406095a640ab10e2eddfbe6ae Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Fri, 26 Sep 2025 20:40:16 +0900 Subject: [PATCH 2/3] Remove unnecessary MSSQL database setup step The Setup MSSQL database step appears redundant - testing if the action can handle database creation itself --- .github/workflows/example.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/example.yaml b/.github/workflows/example.yaml index 7d23a16..1902286 100644 --- a/.github/workflows/example.yaml +++ b/.github/workflows/example.yaml @@ -128,18 +128,6 @@ jobs: with: fetch-depth: 0 - - name: Setup MSSQL database - run: | - # Install sqlcmd tools - sudo apt-get update && sudo apt-get install -y curl gnupg - curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc - curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list - sudo apt-get update - sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18 - - # Create the test database - /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P "Passw0rd" -Q "CREATE DATABASE testdb;" -C - - name: Preview MSSQL schema changes uses: ./ with: From d1475b186b78b7adeb8370c738464bcf423867c5 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Fri, 26 Sep 2025 20:42:01 +0900 Subject: [PATCH 3/3] 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. --- .github/workflows/example.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/example.yaml b/.github/workflows/example.yaml index 1902286..0751eb8 100644 --- a/.github/workflows/example.yaml +++ b/.github/workflows/example.yaml @@ -128,6 +128,11 @@ jobs: with: fetch-depth: 0 + - name: Create MSSQL database + run: | + docker exec $(docker ps -q -f "ancestor=mcr.microsoft.com/mssql/server:2022-latest") \ + /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P "Passw0rd" -Q "CREATE DATABASE testdb;" -C + - name: Preview MSSQL schema changes uses: ./ with: