actionsを修正 #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test with jOOQ and Docker | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| - feature/* | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Set up Docker Compose | |
| run: | | |
| docker-compose up -d | |
| - name: Wait for MySQL to be ready | |
| run: | | |
| until docker exec $(docker ps -qf "ancestor=mysql:latest") mysqladmin ping -uroot -prootpassword --silent; do | |
| echo "Waiting for MySQL to be ready..." | |
| sleep 5 | |
| done | |
| - name: Generate jOOQ Classes | |
| run: ./gradlew generateJooq --info --stacktrace | |
| - name: Build and Run Tests | |
| run: ./gradlew clean build --info --stacktrace | |
| - name: Archive Test Reports | |
| if: always() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: test-reports | |
| path: build/reports/tests/test |