Skip to content

Commit

Permalink
Merge pull request #293 from Team-Sopetit/chore/#292-apply-checkstyle
Browse files Browse the repository at this point in the history
[CHORE] CheckStyle 적용
  • Loading branch information
thguss authored Jun 22, 2024
2 parents e74765f + a6ccc39 commit d4080f2
Show file tree
Hide file tree
Showing 177 changed files with 4,140 additions and 3,578 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/CI.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ci

on:
pull_request:
branches: [ "develop" ]

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: checkout
uses: actions/checkout@v3

- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'

- name: create application.yaml
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_SECRET_YML }}" > ./application-secret.yml
working-directory: ${{ env.working-directory }}

- name: build
run: |
chmod +x gradlew
./gradlew build test
working-directory: ${{ env.working-directory }}
shell: bash

lint:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Execute checkstyleMain
run: ./gradlew clean checkstyleMain

- name: Execute checkstyleTest
run: ./gradlew clean checkstyleTest
17 changes: 17 additions & 0 deletions 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.1'
id 'io.spring.dependency-management' version '1.1.4'
id 'checkstyle'
}

group = 'com.soptie'
Expand All @@ -11,12 +12,21 @@ java {
sourceCompatibility = '17'
}

checkstyle {
maxWarnings = 0
configFile = file("checkstyle/naver-checkstyle-rules.xml")
configProperties = ["suppressionFile": "checkstyle/naver-checkstyle-suppressions.xml"]
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -59,3 +69,10 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

tasks.withType(Checkstyle).configureEach {
reports {
xml.required = true
html.required = true
}
}
Loading

0 comments on commit d4080f2

Please sign in to comment.