Skip to content

Commit

Permalink
#34 CI 워크플로우 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
dldmsql authored Feb 3, 2023
1 parent 402924b commit 9f59d34
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/CI-Dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
pull_request:
branches: [ "develop" ]

permissions: write-all

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# (1) JDK 세팅
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

# (2) gradle 캐싱
- 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-
# (3) gradlew 권한 부여
- name: Grant Execute Permission for gradlew
run: chmod +x gradlew

# (4) 테스트를 위한 yml 세팅
- name: Make application-secret.yml
run: |
cd ./src/main/resources
touch ./application-secret.yml
echo "${{ secrets.PROPERTIES_TEST }}" > ./application-secret.yml
shell : bash

# (5) 테스트
- name: Test with Gradle
run: ./gradlew --info test

# (6) 테스트 후 결과 파일 생성
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ always() }} # 테스트가 실패하여도 Report를 보기 위해 `always`로 설정
with:
files: build/test-results/**/*.xml

0 comments on commit 9f59d34

Please sign in to comment.