Skip to content

๐Ÿ“ Add docstrings to develop #2

๐Ÿ“ Add docstrings to develop

๐Ÿ“ Add docstrings to develop #2

Workflow file for this run

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