Skip to content

Commit bdba831

Browse files
authored
Added MySQL and PostgreSQL services to test-on-main.yml
1 parent aa3ee23 commit bdba831

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/test-on-main.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,36 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212

13+
services:
14+
postgres:
15+
image: postgres:15
16+
env:
17+
POSTGRES_PASSWORD: test_password
18+
POSTGRES_USER: test_user
19+
POSTGRES_DB: test_db
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
ports:
26+
- 5432:5432
27+
28+
mysql:
29+
image: mysql:8.0
30+
env:
31+
MYSQL_ROOT_PASSWORD: root_password
32+
MYSQL_DATABASE: test_db
33+
MYSQL_USER: test_user
34+
MYSQL_PASSWORD: test_password
35+
options: >-
36+
--health-cmd="mysqladmin ping"
37+
--health-interval=10s
38+
--health-timeout=5s
39+
--health-retries=5
40+
ports:
41+
- 3306:3306
42+
1343
steps:
1444
- name: Checkout javaxt-core
1545
uses: actions/checkout@v4
@@ -23,6 +53,28 @@ jobs:
2353
- name: Clone javaxt-core-test
2454
run: git clone https://github.com/javaxt-project/javaxt-core-test.git
2555

56+
- name: Configure PostgreSQL for tests
57+
run: |
58+
cd javaxt-core-test/javaxt-core-test/src/test/resources
59+
cat > postgresql.properties << EOF
60+
db.host=localhost
61+
db.port=5432
62+
db.name=test_db
63+
db.user=test_user
64+
db.password=test_password
65+
EOF
66+
67+
- name: Configure MySQL for tests
68+
run: |
69+
cd javaxt-core-test/javaxt-core-test/src/test/resources
70+
cat > mysql.properties << EOF
71+
db.host=localhost
72+
db.port=3306
73+
db.name=test_db
74+
db.user=test_user
75+
db.password=test_password
76+
EOF
77+
2678
- name: Build and test with javaxt-core-test
2779
run: |
2880
cd javaxt-core-test

0 commit comments

Comments
 (0)