From 45dafb15cd50e41eb17710c4539cda4a857da2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9D=80=EB=B9=84?= <61505572+dldmsql@users.noreply.github.com> Date: Sun, 9 Jul 2023 09:22:41 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20sonarCloud=20=EC=97=B0=EB=8F=99=20?= =?UTF-8?q?=EC=95=A1=EC=85=98=20=ED=8C=8C=EC=9D=BC=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sonar.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..fed141a --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,44 @@ +name: SonarCloud +on: + push: + branches: + - develop + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: SetUp JDK 17 + uses: actions/setup-java@v2 + with: + java-version: "17" + distribution: 'adopt' + + - name: Grant execute permission for gradlew + run: chmod +x ./gradlew + + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew build sonar --info