Skip to content

Commit

Permalink
Merge pull request #2 from everymeals/chore/project-setting
Browse files Browse the repository at this point in the history
chore: #1 sonarCloud 프로퍼티 설정
  • Loading branch information
dldmsql authored Jul 9, 2023
2 parents 45dafb1 + afd20ce commit f9df265
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
36 changes: 14 additions & 22 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,33 @@ on:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
sonarcloud:
name: SonarCloud
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
fetch-depth: 0
- name: Set up 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

java-version: 17
distribution: 'zulu'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build and analyze
run: ./gradlew build sonar --info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.1.1'
id 'io.spring.dependency-management' version '1.1.0'
id "org.sonarqube" version "4.2.1.3168"
}

group = 'everymeal'
version = '0.0.1-SNAPSHOT'

sonar {
properties {
property "sonar.projectKey", "everymeals_EveryMeal_Server"
property "sonar.organization", "everymeals"
property "sonar.host.url", "https://sonarcloud.io"
property 'sonar.sources', 'src'
property 'sonar.language', 'java'
property 'sonar.sourceEncoding', 'UTF-8'
property "sonar.exclusions", "**/*Application*.java"
}
}

java {
sourceCompatibility = '17'
}
Expand Down

0 comments on commit f9df265

Please sign in to comment.