fix: Correct file download path error #65
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: Backend Main Continuous Integration | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - main | |
| paths: | |
| - "backend/main-service/**" | |
| workflow_dispatch: | |
| permissions: write-all | |
| env: | |
| DEVLOG_GOOGLE_CLIENT_ID: ${{ secrets.DEVLOG_GOOGLE_CLIENT_ID }} | |
| DEVLOG_GOOGLE_CLIENT_SECRET: ${{ secrets.DEVLOG_GOOGLE_CLIENT_SECRET }} | |
| jobs: | |
| # 사전 작업 | |
| setup: | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| working-directory: backend/main-service | |
| outputs: | |
| build-cache-key: ${{ steps.build-cache.outputs.key }} | |
| current-datetime: ${{ steps.datetime.outputs.datetime }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: check | |
| run: ls -al | |
| - name: Get current date and time | |
| id: datetime | |
| run: echo "datetime=$(date '+%Y-%m-%d_%H-%M-%S')" >> $GITHUB_OUTPUT | |
| - name: Generate build cache key | |
| id: build-cache | |
| run: echo "key=$(echo build-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }})" >> $GITHUB_OUTPUT | |
| unit-test: | |
| needs: setup | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| working-directory: backend/main-service | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Gradle packages | |
| id: cache-gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ needs.setup.outputs.build-cache-key }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Cache Check | |
| if: steps.cache-gradle.outputs.cache-hit == 'true' | |
| run: echo 'Gradle cache hit!' | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: "temurin" | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Run unit tests | |
| run: ./gradlew test | |
| - name: Upload unit test HTML report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: unit-test-report | |
| path: backend/main-service/build/reports/tests/test | |
| - name: publish unit test results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: backend/main-service/build/test-results/test/TEST-*.xml | |
| - name: add comments to a pull request | |
| uses: mikepenz/action-junit-report@v4 | |
| if: github.event_name == 'pull_request' && always() | |
| with: | |
| report_paths: backend/main-service/build/test-results/test/TEST-*.xml | |
| code-coverage-test: | |
| needs: setup | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| working-directory: backend/main-service | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Gradle packages | |
| id: cache-gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ needs.setup.outputs.build-cache-key }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Cache Check | |
| if: steps.cache-gradle.outputs.cache-hit == 'true' | |
| run: echo 'Gradle cache hit!' | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: "temurin" | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Generate Jacoco Report | |
| run: ./gradlew jacocoTestReport | |
| - name: Add Jacoco coverage to PR | |
| if: github.event_name == 'pull_request' && always() | |
| uses: madrapps/jacoco-report@v1.6.1 | |
| with: | |
| paths: backend/main-service/build/reports/jacoco/test/jacocoTestReport.xml | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| min-coverage-overall: 80 | |
| min-coverage-changed-files: 80 | |
| title: Code Coverage | |
| update-comment: true | |
| - name: Upload jacoco HTML report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: jacoco-html-report | |
| path: backend/main-service/build/reports/jacoco/test/html |