질문 도메인의 API, Service 기능 구현 및 테스트 작성 #1
This file contains 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
# main 브랜치에 PR 이벤트가 발생하면 Workflow가 실행된다. | |
# 브랜치 구분이 없으면 on: [pull_request]로 해주어도 된다. | |
on: | |
pull_request: | |
branches: [ "main" ] | |
# 테스트 결과 작성을 위해 쓰기권한 추가 | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Gradle Caching | |
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: Grant Execute Permission For Gradlew | |
run: chmod +x gradlew | |
- name: Build With Gradle | |
run: ./gradlew build | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v1 | |
if: ${{ always() }} | |
with: | |
files: build/test-results/**/*.xml | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v3 | |
if: success() || failure() # always run even if the previous step fails | |
with: | |
report_paths: '**/build/test-results/test/TEST-*.xml' |