Update application-prod.yml #373
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/test | |
| on: | |
| pull_request: | |
| branches: ["main", "dev"] | |
| push: | |
| branches: ["dev"] | |
| permissions: | |
| contents: read | |
| checks: write | |
| issues: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 # clone repository | |
| # Caching Gradle | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| # 프로젝트 세팅에 맞게 수정할 것! | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 # set up the required java version | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Gradle Authorization | |
| run: chmod +x gradlew | |
| # Gradle run (application-test.yml 환경설정으로 빌드하기 위해 -Dspring.profiles.active 옵션 추가) | |
| - name: Gradle Build Run | |
| run: ./gradlew -Dspring.profiles.active=test build | |
| # Gradle test | |
| - name: Test with Gradle | |
| run: ./gradlew -Dspring.profiles.active=test --info test | |
| # Publish Unit Test Results | |
| - name: Publish Unit Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v1 | |
| if: ${{ always() }} | |
| with: | |
| files: "build/test-results/**/*.xml" | |
| - name: Cleanup Gradle Cache | |
| if: ${{ always() }} | |
| run: | | |
| rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
| rm -f ~/.gradle/caches/modules-2/gc.properties | |
| - name: Upload Gradle problems report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gradle-problems-report | |
| path: build/reports/problems | |
| - name: Upload Gradle test report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gradle-test-report | |
| path: build/reports/tests/test |