Skip to content
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.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Template

on:
workflow_dispatch:

permissions:
contents: read

jobs:
verify:
if: ${{ false }}
name: ${{ matrix.project }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
project:
- template/spring-boot-kotlin
- template/spring-boot-kotlin-multi-module

env:
SPOTLESS_RATCHET_FROM: ${{ github.event.pull_request.base.sha }}

steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "25"

- uses: gradle/actions/setup-gradle@v6

- name: Spotless Check
working-directory: ${{ matrix.project }}
run: ./gradlew spotlessCheck

- name: Gradle Test
working-directory: ${{ matrix.project }}
run: ./gradlew test

- name: Gradle Build
working-directory: ${{ matrix.project }}
run: ./gradlew build
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ kotlin scripts/git/git-workflow.main.kts finish TASK_ID
- [Must] `spotlessApply`, `test`, `build` 순으로 실행해야 합니다. `check`는 별도로 실행하지 않습니다.

```sh
./gradlew spotlessApply # 전체 파일에 기계적 포맷을 적용합니다.
./gradlew spotlessApply # HEAD 이후 변경된 파일에 기계적 포맷을 적용합니다.
./gradlew test --tests "com.example.mypackage.*" # Task 범위의 패키지 테스트를 실행합니다.
./gradlew build # clean 없이 증분 빌드를 실행합니다.
```

Spotless의 기준 Git ref는 `-PspotlessRatchetFrom` 또는 `SPOTLESS_RATCHET_FROM`으로 지정합니다. 둘 다 지정하지 않으면 `HEAD`를 사용합니다. PR CI에서는 병합 대상 브랜치의 base SHA를 `SPOTLESS_RATCHET_FROM`으로 전달해 `spotlessCheck`를 실행합니다.

# 주요 디렉터리

아직 작성하지 않았습니다.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ base {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ base {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ base {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

Expand Down
12 changes: 10 additions & 2 deletions template/spring-boot-kotlin-multi-module/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
plugins {
kotlin("jvm") version "2.3.21" apply false
kotlin("plugin.spring") version "2.3.21" apply false
kotlin("jvm") version "2.2.21" apply false
kotlin("plugin.spring") version "2.2.21" apply false
id("org.springframework.boot") version "4.1.1" apply false
id("io.spring.dependency-management") version "1.1.7" apply false
id("com.epages.restdocs-api-spec") version "0.20.1" apply false
id("com.diffplug.spotless") version "8.10.2"
}

val spotlessRatchetFrom =
providers
.gradleProperty("spotlessRatchetFrom")
.orElse(providers.environmentVariable("SPOTLESS_RATCHET_FROM"))
.getOrElse("HEAD")

spotless {
isEnforceCheck = false
ratchetFrom(spotlessRatchetFrom)

kotlinGradle {
target("**/*.gradle.kts")
Expand All @@ -32,6 +39,7 @@ subprojects {

configure<com.diffplug.gradle.spotless.SpotlessExtension> {
isEnforceCheck = false
ratchetFrom(spotlessRatchetFrom)

kotlin {
target("src/*/kotlin/**/*.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ base {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

Expand Down
13 changes: 10 additions & 3 deletions template/spring-boot-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
kotlin("jvm") version "2.3.21"
kotlin("plugin.spring") version "2.3.21"
kotlin("jvm") version "2.2.21"
kotlin("plugin.spring") version "2.2.21"
id("org.springframework.boot") version "4.1.1"
id("io.spring.dependency-management") version "1.1.7"
id("com.diffplug.spotless") version "8.10.2"
Expand All @@ -16,16 +16,23 @@ base {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(24)
}
}

repositories {
mavenCentral()
}

val spotlessRatchetFrom =
providers
.gradleProperty("spotlessRatchetFrom")
.orElse(providers.environmentVariable("SPOTLESS_RATCHET_FROM"))
.getOrElse("HEAD")

spotless {
isEnforceCheck = false
ratchetFrom(spotlessRatchetFrom)

kotlin {
target("src/*/kotlin/**/*.kt")
Expand Down