-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
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
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 |