๐ Add docstrings to develop
#2
Workflow file for this run
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 Coverage | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| checks: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{secrets.CONFIG_SUBMODULE_TOKEN}} | |
| submodules: recursive | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| #๋ผ์ด๋ธ๋ฌ๋ฆฌ ์บ์ฑ | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| #Gradle ๋น๋ ๋ฐ ํ ์คํธ | |
| - name: Build and Test with Gradle | |
| run: ./gradlew clean build test jacocoTestReport | |
| #์คํจ์ ์คํจ ์ฝ๋์ ์ฝ๋ฉํธ | |
| - name: If the test fails, register a check comment in the failed code line | |
| uses: mikepenz/action-junit-report@v3 | |
| if: always() | |
| with: | |
| report_paths: '**/build/test-results/test/TEST-*.xml' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| #ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง ๋ฆฌํฌํธ ์์ฑ ํ์ธ | |
| - name: Check if coverage report exists and is valid | |
| id: check_coverage | |
| run: | | |
| FILE_PATH="${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml" | |
| if [ -s "$FILE_PATH" ] && grep -q "<counter type=\"LINE\" missed=\"0\"" "$FILE_PATH"; then | |
| echo "Coverage report exists and is not empty with coverage." | |
| echo "::set-output name=exists::true" | |
| else | |
| echo "Coverage report exists but has no coverage or is empty." | |
| echo "::set-output name=exists::false" | |
| fi | |
| #ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง ๋ฆฌํฌํธ ์ถ๋ ฅ | |
| - name: Add coverage to PR | |
| if: steps.check_coverage.outputs.exists == 'true' | |
| id: jacoco | |
| uses: madrapps/jacoco-report@v1.2 | |
| with: | |
| title: ๐ ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง ๋ฆฌํฌํธ์ ๋๋ค! | |
| paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| min-coverage-overall: 80 | |
| min-coverage-changed-files: 80 |