Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
156 changes: 80 additions & 76 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,80 @@
name: Checkstyle

on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop

jobs:
checkstyle:
name: Code Style Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_TOKEN }}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

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

- name: Run Checkstyle
run: ./gradlew checkstyleMain --no-daemon

- name: Upload Checkstyle Report
if: failure()
uses: actions/upload-artifact@v4
with:
name: checkstyle-report
path: |
build/reports/checkstyle/main.html
build/reports/checkstyle/main.xml
retention-days: 7

- name: Comment PR with Checkstyle Results
if: github.event_name == 'pull_request' && failure()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');

let comment = '## ⚠️ Checkstyle 위반 사항 발견\n\n';
comment += 'Checkstyle 검사에서 코딩 컨벤션 위반이 발견되었습니다.\n\n';
comment += '### 📋 상세 리포트\n';
comment += '- [Main 소스 리포트 다운로드](../actions/runs/${{ github.run_id }})\n';

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
name: Checkstyle

on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop

permissions:
contents: read
pull-requests: write

jobs:
checkstyle:
name: Code Style Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_TOKEN }}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

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

- name: Run Checkstyle
run: ./gradlew checkstyleMain --no-daemon

- name: Upload Checkstyle Report
if: failure()
uses: actions/upload-artifact@v4
with:
name: checkstyle-report
path: |
build/reports/checkstyle/main.html
build/reports/checkstyle/main.xml
retention-days: 7

- name: Comment PR with Checkstyle Results
if: github.event_name == 'pull_request' && failure()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');

let comment = '## ⚠️ Checkstyle 위반 사항 발견\n\n';
comment += 'Checkstyle 검사에서 코딩 컨벤션 위반이 발견되었습니다.\n\n';
comment += '### 📋 상세 리포트\n';
comment += '- [Main 소스 리포트 다운로드](../actions/runs/${{ github.run_id }})\n';

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
Loading
Loading