Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/test ci #2

Merged
merged 6 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문서를 보면

The cache input is optional, and caching is turned off by default.

라고 되어 있는데 cache: gradle로 캐시를 켜두는게 어떨까?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 적용했어용 👍

java-version: 17
distribution: 'temurin'
cache: 'gradle'

- name: grant permission to gradle
run: chmod +x gradlew

- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- 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

- name: Backend CI Discord Notification
uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
title: ❗️ Backend CI failed ❗️
webhook: ${{ secrets.DISCORD_URL }}
color: FF0000
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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public class PlatformCoreApplication {

public static void main(String[] args) {
SpringApplication.run(PlatformCoreApplication.class, args);
System.out.println("TESTCITEST");
}
}
Loading