Skip to content

Commit

Permalink
chore: quality gate workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
seungminyi committed Mar 6, 2024
1 parent 0f1ef61 commit 0ed2f17
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflow/qualitygate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: SonarCloud
on:
push:
branches:
- main
- chore/add-sonarcloud
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
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- 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 bm-controller
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: cd bm-controller && ./gradlew build sonar --info
- name: Build and analyze bm-agent
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: cd bm-agent && ./gradlew build sonar --info

9 changes: 9 additions & 0 deletions bm-agent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id "org.sonarqube" version "4.4.1.3373"
}

group = 'org.benchmark'
Expand Down Expand Up @@ -33,3 +34,11 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

sonar {
properties {
property "sonar.projectKey", "backend-tech-forge_benchmark"
property "sonar.organization", "backend-tech-forge"
property "sonar.host.url", "https://sonarcloud.io"
}
}
9 changes: 9 additions & 0 deletions bm-controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id "org.sonarqube" version "4.4.1.3373"
}

group = 'org.benchmark'
Expand Down Expand Up @@ -43,3 +44,11 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

sonar {
properties {
property "sonar.projectKey", "backend-tech-forge_benchmark"
property "sonar.organization", "backend-tech-forge"
property "sonar.host.url", "https://sonarcloud.io"
}
}

0 comments on commit 0ed2f17

Please sign in to comment.