Skip to content

Feature/lil/get drive hisotry days #136

Feature/lil/get drive hisotry days

Feature/lil/get drive hisotry days #136

Workflow file for this run

name: Dev-CI
permissions:
contents: read
issues: read
checks: write
pull-requests: write
on:
pull_request:
types:
- opened
- synchronize
branches:
- 'dev'
jobs:
build-dev:
environment: dev # github에서 설정한 환경 Secret 파일 사용
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
# gradle caching
- 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-
# src application 파일 생성
- name: make application-test.yml
run: |
mkdir ./src/main/resources
cd ./src/main/resources
touch ./application.yml
echo "${{ secrets.YML }}" > ./application.yml
shell: bash
- name: make Test application.yml
run: |
mkdir ./src/test/resources
cd ./src/test/resources
touch ./application-test.yml
echo "${{ secrets.TEST_YML }}" > ./application-test.yml
# 권한 부여
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# 빌드 진행
- name: Build with Gradle
shell: bash
run: ./gradlew build
# --no-daemon \
# -Dorg.gradle.jvmargs=-Xmx1024m \
# --build-cache \
# --project-cache-dir=./gradle-cache/project \
# --gradle-user-home=./gradle-cache/global \
# --project-dir="./"
# 테스트 빌드 진행
# - name: Test Build with Gradle
# run: ./gradlew test
# test 결과 업로드
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: build/test-results
# Coverage 동작 확인용
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/reports/jacoco/test/jacocoTestReport.xml
- name: 테스트 커버리지를 PR에 코멘트로 등록합니다.
id: jacoco
uses: madrapps/[email protected]
with:
title: 📝 테스트 커버리지 리포트입니다
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GIT_HUB_TOKEN }}
min-coverage-overall: 50
min-cove`rage-changed-files: 50
- name: 테스트 결과를 PR에 코멘트로 등록합니다.
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'
slack_noti:
name: Slack_notification
runs-on: ubuntu-latest
needs: build-dev
steps:
- name: action-slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: dev CI 빌드 알림
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: always() # Pick up events even if the job fails or is canceled.