diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradleCD.yml similarity index 100% rename from .github/workflows/gradle.yml rename to .github/workflows/gradleCD.yml diff --git a/.github/workflows/gradleCI.yml b/.github/workflows/gradleCI.yml new file mode 100644 index 00000000..dc800866 --- /dev/null +++ b/.github/workflows/gradleCI.yml @@ -0,0 +1,47 @@ +name: Java CI with Gradle + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "*" ] + +permissions: + contents: read + + +jobs: + build-and-test: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + # 환경별 properties 파일 생성 - API-KEY + - name: make application-API-KEY.properties + run: | + cd ./src/main/resources + touch ./application-API-KEY.properties + echo "${{ secrets.YML_CI }}" > ./application-API-KEY.properties + shell: bash + + - name: Run chmod to make gradlew executable + run: chmod +x ./gradlew + + # gradle build + - name: Build with Gradle + run: ./gradlew clean build -x test + + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 759b9eb4..96a61f25 100644 --- a/build.gradle +++ b/build.gradle @@ -118,6 +118,9 @@ test { } jacocoTestReport { dependsOn test + reports{ + xml.required = true + } afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect {