File tree Expand file tree Collapse file tree 1 file changed +25
-13
lines changed
Expand file tree Collapse file tree 1 file changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -26,27 +26,39 @@ jobs:
2626 image : mcr.microsoft.com/mssql/server:2025-latest
2727 env :
2828 ACCEPT_EULA : " Y"
29- SA_PASSWORD : ${{ secrets.MSSQL_SA_PASSWORD }}
29+ SA_PASSWORD : " P@ssw0rd12345! "
3030 ports :
3131 - 1433:1433
32- options : >-
33- --health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P '${{ secrets. MSSQL_SA_PASSWORD }}' -Q 'SELECT 1' -C"
34- --health-start-period=20s
35- --health-interval=2s
36- --health-retries=30
37- --health-timeout=5s
32+ # options: >-
33+ # --health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P $ MSSQL_SA_PASSWORD -Q 'SELECT 1' -C"
34+ # --health-start-period=20s
35+ # --health-interval=2s
36+ # --health-retries=30
37+ # --health-timeout=5s
3838
3939 permissions :
4040 contents : read
4141
4242 # You can define any steps you want, and they will run before the agent starts.
4343 # If you do not check out your code, Copilot will do this for you.
4444 steps :
45- - name : Checkout
46- uses : actions/checkout@v5
45+ - name : Wait for SQL Server to be ready
46+ shell : bash
47+ run : |
48+ # Simple wait loop; the container typically needs ~10-20s
49+ for i in {1..60}; do
50+ if docker exec mssql /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "P@ssw0rd12345!" -Q "SELECT 1" -C &>/dev/null; then
51+ echo "SQL Server is up"
52+ break
53+ fi
54+ echo "Waiting for SQL Server..." && sleep 1
55+ done
4756
48- - name : Restore
49- run : ./restore.sh
57+ # - name: Checkout
58+ # uses: actions/checkout@v5
5059
51- - name : Export SQL Server connection string for the agent's session
52- run : echo "Test__SqlServer__DefaultConnection=Server=localhost;Database=master;User=SA;Password=${{ secrets.MSSQL_SA_PASSWORD }};Connect Timeout=60;ConnectRetryCount=0;Trust Server Certificate=true" >> "$GITHUB_ENV"
60+ # - name: Restore
61+ # run: ./restore.sh
62+
63+ # - name: Export SQL Server connection string for the agent's session
64+ # run: echo "Test__SqlServer__DefaultConnection=Server=localhost;Database=master;User=SA;Password=${MSSQL_SA_PASSWORD};Connect Timeout=60;ConnectRetryCount=0;Trust Server Certificate=true" >> "$GITHUB_ENV"
You can’t perform that action at this time.
0 commit comments