Skip to content

Commit 9449e50

Browse files
actionsを修正
1 parent 4f9f4b9 commit 9449e50

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ jobs:
2222
run: |
2323
sudo curl -L "https://github.com/docker/compose/releases/download/v2.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2424
sudo chmod +x /usr/local/bin/docker-compose
25-
docker-compose version
2625
2726
- name: Start MySQL with Docker Compose
2827
run: docker-compose up -d
2928

30-
- name: Check Docker Compose Logs
31-
run: docker-compose logs mysql
32-
3329
- name: Wait for MySQL to be ready
3430
run: |
3531
timeout 60s bash -c '
@@ -39,19 +35,15 @@ jobs:
3935
done
4036
'
4137
38+
- name: Set MYSQL_HOST for CI
39+
run: echo "MYSQL_HOST=mysql" >> $GITHUB_ENV
40+
4241
- name: Set up JDK 21
4342
uses: actions/setup-java@v3
4443
with:
4544
distribution: 'temurin'
4645
java-version: '21'
4746

48-
- name: Wait for MySQL to be ready
49-
run: |
50-
until docker exec $(docker ps -qf "ancestor=mysql:latest") mysqladmin ping -uroot -prootpassword --silent; do
51-
echo "Waiting for MySQL to be ready..."
52-
sleep 5
53-
done
54-
5547
- name: Generate jOOQ Classes and Build
5648
run: ./gradlew clean generateJooq build --info --stacktrace
5749

dbAndCsvBatch/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jooq {
8080
generationTool {
8181
jdbc {
8282
driver = 'com.mysql.cj.jdbc.Driver'
83-
url = 'jdbc:mysql://localhost:3306/sampledb'
83+
url = "jdbc:mysql://${System.getenv('MYSQL_HOST') ?: 'localhost'}:3306/sampledb"
8484
user = 'sampleuser'
8585
password = 'samplepassword'
8686
}

0 commit comments

Comments
 (0)