actionsを修正 #42
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: Install Docker Compose | |
| run: | | |
| 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 | |
| sudo chmod +x /usr/local/bin/docker-compose | |
| - name: Start MySQL with Docker Compose | |
| run: docker-compose up -d | |
| - name: Wait for MySQL to be ready | |
| run: | | |
| timeout 60s bash -c ' | |
| 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: Set MYSQL_HOST for CI | |
| run: echo "MYSQL_HOST=mysql" >> $GITHUB_ENV | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Generate jOOQ Classes and Build | |
| run: ./gradlew clean generateJooq build --info --stacktrace | |
| - name: Archive Test Reports | |
| if: always() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: test-reports | |
| path: build/reports/tests/test |