특정 다이어리 댓글 전체 조회(커서 기반) API 구현 #3
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: log4u-dev-build | |
| on: | |
| pull_request: | |
| branches: | |
| - develop # develop pr | |
| types: [ opened, synchronize, reopened ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build and analyze | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'zulu' # Alternative distribution options are available | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
| restore-keys: ${{ runner.os }}-gradle | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: MySQL 컨테이너 실행 | |
| run: | | |
| docker run --name test-mysql \ | |
| -e MYSQL_ROOT_PASSWORD=root \ | |
| -e MYSQL_DATABASE=log4u \ | |
| -e MYSQL_USER=dev \ | |
| -e MYSQL_PASSWORD=devcos4-team08 \ | |
| -d \ | |
| -p 3307:3306 \ | |
| mysql:8.0.33 | |
| - name: Build and analyze | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| DB_URL: jdbc:mysql://localhost:3307/log4u | |
| DB_USERNAME: dev | |
| DB_PASSWORD: devcos4-team08 | |
| # dev 프로필 사용 | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew build jacocoTestReport sonar --info -Pprofile=dev -Dsonar.branch.name=${{ github.ref_name }} | |
| - name: Docker MySQL 종료 및 제거 | |
| run: | | |
| docker stop log4u-mysql | |
| docker rm log4u-mysql | |
| - name: Upload Test Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: problems-report | |
| path: build/reports/problems/problems-report.html |