Skip to content

Commit

Permalink
refactor: github action extract same password (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
bestlong authored Aug 28, 2024
1 parent 4868f09 commit aa42381
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
matrix:
node-version: [16, 18]

env:
SA_PASSWORD: "P@ssw0rdP@ssw0rd"

services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
Expand All @@ -32,7 +35,7 @@ jobs:
--health-timeout 10s
--health-retries 5
env:
SA_PASSWORD: "P@ssw0rdP@ssw0rd"
SA_PASSWORD: ${{ env.SA_PASSWORD }}
ACCEPT_EULA: "Y"

steps:
Expand All @@ -44,13 +47,13 @@ jobs:
- name: Wait for SQL Server to be ready
run: |
for i in {1..30}; do
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P P@ssw0rdP@ssw0rd -Q "SELECT 1" && break
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${{ env.SA_PASSWORD }} -Q "SELECT 1" && break
sleep 1
done
- name: Create database
run: |
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P P@ssw0rdP@ssw0rd -Q "CREATE DATABASE testdb"
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${{ env.SA_PASSWORD }} -Q "CREATE DATABASE testdb"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down

0 comments on commit aa42381

Please sign in to comment.