Skip to content

Commit 81bb110

Browse files
actionsを修正
1 parent 4fc96c4 commit 81bb110

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,32 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
# リポジトリのチェックアウト
1918
- name: Checkout repository
2019
uses: actions/checkout@v3
2120

22-
# Docker Composeのインストール
2321
- name: Install Docker Compose
2422
run: |
2523
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
2624
sudo chmod +x /usr/local/bin/docker-compose
2725
28-
# MySQLの起動
2926
- name: Start MySQL with Docker Compose
3027
run: docker-compose up -d
3128

32-
# MySQLが準備完了するまで待機
33-
- name: Wait for MySQL to be ready
29+
- name: Wait for MySQL to initialize
3430
run: |
3531
timeout 60s bash -c '
36-
until docker exec $(docker ps -qf "ancestor=mysql:latest") mysqladmin ping -uroot -prootpassword --silent; do
32+
until docker exec mysql mysqladmin ping -uroot -prootpassword --silent; do
3733
echo "Waiting for MySQL to be ready..."
3834
sleep 5
3935
done
4036
'
4137
42-
# MySQLの初期化確認
4338
- name: Verify MySQL Initialization
4439
run: |
45-
docker exec $(docker ps -qf "ancestor=mysql:latest") mysql -usampleuser -psamplepassword -e "SHOW TABLES;" sampledb
40+
docker exec mysql mysql -uroot -prootpassword -e "SHOW TABLES;" sampledb || echo "No tables found"
4641
47-
# MySQLログの確認(デバッグ用)
48-
- name: Check MySQL Logs
42+
# デバッグ用ログ確認
43+
- name: Check MySQL Logs on Failure
4944
if: failure()
5045
run: docker-compose logs mysql
5146

@@ -56,11 +51,6 @@ jobs:
5651
distribution: 'temurin'
5752
java-version: '21'
5853

59-
# データベース状態の確認
60-
- name: Check Database State
61-
run: |
62-
docker exec $(docker ps -qf "ancestor=mysql:latest") mysql -usampleuser -psamplepassword -e "SELECT * FROM member;" sampledb
63-
6454
# jOOQクラス生成とビルド
6555
- name: Generate jOOQ Classes and Build
6656
run: ./gradlew clean generateJooq build --info --stacktrace

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3'
1+
version: '3.9'
22
services:
33
mysql:
44
image: mysql:latest

0 commit comments

Comments
 (0)