diff --git a/.github/workflows/CI-Dev.yml b/.github/workflows/CI-Dev.yml new file mode 100644 index 0000000..e0504b2 --- /dev/null +++ b/.github/workflows/CI-Dev.yml @@ -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