Skip to content

Commit 727e9fd

Browse files
committed
fix(workflows): reorder creation of test databases
Reorganize the workflow steps to ensure the creation of test databases occurs after the NuGet package caching and before the testing phase. - Moved the "Create test databases" step to follow the "Cache NuGet packages" step. - Ensured that the database creation logic remains intact and functional.
1 parent b384922 commit 727e9fd

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/dotnet-test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ jobs:
8080
echo "SQL Server did not become reachable in time."
8181
exit 1
8282
83-
- name: Create test databases
84-
shell: bash
85-
run: |
86-
docker exec "${{ job.services.sqlserver.id }}" /opt/mssql-tools18/bin/sqlcmd \
87-
-S localhost \
88-
-U sa \
89-
-P "$SQLHELPER_SQL_PASSWORD" \
90-
-C \
91-
-Q "IF DB_ID(N'TestDatabase') IS NULL CREATE DATABASE [TestDatabase]; IF DB_ID(N'TestDatabase2') IS NULL CREATE DATABASE [TestDatabase2]; IF DB_ID(N'MockDatabase') IS NULL CREATE DATABASE [MockDatabase]; IF DB_ID(N'MockDatabaseForMockMapping') IS NULL CREATE DATABASE [MockDatabaseForMockMapping];"
92-
9383
- name: Cache NuGet packages
9484
uses: actions/cache@v4
9585
with:
@@ -104,6 +94,16 @@ jobs:
10494
- name: Build
10595
run: dotnet build "$SOLUTION_FILE" --no-restore --configuration $BUILD_CONFIG
10696

97+
- name: Create test databases
98+
shell: bash
99+
run: |
100+
docker exec "${{ job.services.sqlserver.id }}" /opt/mssql-tools18/bin/sqlcmd \
101+
-S localhost \
102+
-U sa \
103+
-P "$SQLHELPER_SQL_PASSWORD" \
104+
-C \
105+
-Q "IF DB_ID(N'TestDatabase') IS NULL CREATE DATABASE [TestDatabase]; IF DB_ID(N'TestDatabase2') IS NULL CREATE DATABASE [TestDatabase2]; IF DB_ID(N'MockDatabase') IS NULL CREATE DATABASE [MockDatabase]; IF DB_ID(N'MockDatabaseForMockMapping') IS NULL CREATE DATABASE [MockDatabaseForMockMapping];"
106+
107107
- name: Test
108108
run: dotnet test "$SOLUTION_FILE" /p:Configuration=$BUILD_CONFIG --no-build --verbosity normal --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}" $TEST_FILTER
109109

0 commit comments

Comments
 (0)