Skip to content

Commit

Permalink
Gitactions Test (#1)
Browse files Browse the repository at this point in the history
* feat : 소나큐브 플러그인 의존성추가

* fix: 그래들 파일 수정

* feat: CI용 워크플로우생성
  • Loading branch information
ekgns33 authored Jun 29, 2024
1 parent fc130e8 commit 8832e10
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/actions/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: SonarCloud
on:
push:
branches:
- main
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: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available

- name: grant permission to gradle
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.TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.3.1'
id 'io.spring.dependency-management' version '1.1.5'
id "org.sonarqube" version "4.4.1.3373"

}

group = 'gdsc.konkuk'
Expand Down Expand Up @@ -36,3 +38,12 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

// sonarqube plugins
sonar {
properties {
property "sonar.projectKey", "gdsc-konkuk_platform-core"
property "sonar.organization", "gdsc-konkuk"
property "sonar.host.url", "https://sonarcloud.io"
}
}

0 comments on commit 8832e10

Please sign in to comment.