Skip to content

Commit 53a8f22

Browse files
authored
added mssql test
1 parent c31cab0 commit 53a8f22

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,47 @@ jobs:
2828
- name: PMD with Maven
2929
run: mvn pmd:pmd --file pom.xml
3030

31+
test-mssql:
32+
runs-on: ubuntu-latest
33+
needs: build
34+
services:
35+
mssql:
36+
image: mcr.microsoft.com/mssql/server:2022-latest
37+
env:
38+
ACCEPT_EULA: Y
39+
MSSQL_SA_PASSWORD: veryStrong123
40+
ports:
41+
- 1433:1433
42+
options: >-
43+
--health-cmd "echo 'SELECT 1' | /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P veryStrong123"
44+
--health-interval=10s
45+
--health-timeout=5s
46+
--health-retries=3
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Set up JDK 21
51+
uses: actions/setup-java@v4
52+
with:
53+
java-version: '21'
54+
distribution: 'temurin'
55+
cache: maven
56+
57+
- name: Wait for MSSQL
58+
run: |
59+
for i in {1..30}; do
60+
if echo "SELECT 1" | /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P veryStrong123 &> /dev/null; then
61+
echo "MSSQL is ready!"
62+
break
63+
fi
64+
echo "Waiting for MSSQL to be ready..."
65+
sleep 2
66+
done
67+
68+
- name: Run Core Module Tests
69+
run: mvn test -pl core -am -Dspring.profiles.active=mysql
70+
71+
3172
java-doc:
3273
runs-on: ubuntu-latest
3374
if: ${{ github.ref == 'refs/heads/main' }}

0 commit comments

Comments
 (0)