Skip to content

[#121] README.md에 프로젝트 관련 내용 추가 #256

[#121] README.md에 프로젝트 관련 내용 추가

[#121] README.md에 프로젝트 관련 내용 추가 #256

Workflow file for this run

name: ci
on:
push: # 아래 브랜치에 Push되면 작동
branches: [ "develop" ]
pull_request: # 아래 브랜치에 PullRequest 되면 작동
branches: [ "develop" ]
# PR check, Comment 권한 설정
permissions:
checks: write
pull-requests: write
# 작업들
jobs:
# 작업 명(본인이 지으면 됨)
build:
runs-on: ubuntu-latest # 대여해주는 서버
env:
REDIS_HOST: ${{ secrets.LOCAL_REDIS_HOST }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
REDIS_PASSWORD: ${{ secrets.LOCAL_REDIS_PASSWORD }}
steps:
- uses: actions/checkout@v3 # 코드 저장소에 올려둔 코드 CI 서버 내려받은 후 특정 브랜치 전환하는 행위
- name: Set up JDK 17
uses: actions/setup-java@v3 # 요청한 자바 버전 다운로드하고 설정
with:
java-version: '17' # 지바 버전에 따라 다르게 설정 필요
distribution: 'temurin'
- name: Build with Gradle # 빌드 작업
uses: gradle/gradle-build-action@v2
with:
arguments: build
# https://github.com/EnricoMi/publish-unit-test-result-action
- name: 테스트 결과를 'PR 코멘트'로 자동 작성
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() # 실패 여부 상관없이 항상 실행~
with:
files: build/test-results/test/TEST-*.xml
# https://github.com/mikepenz/action-junit-report
- name: 테스트 코드 중 테스트 실패한 부분에 'PR check'로 자동 작성
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: build/test-results/test/TEST-*.xml
- name: 테스트 커버리지 리포트
id: jacoco
uses: madrapps/jacoco-report@v1.6
with:
title: Test Coverage Report
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 30
min-coverage-changed-files: 50
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build and analyze
run: ./gradlew build jacocoTestReport sonar --info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}