-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1014 Bytes
/
code-style-test.yml
File metadata and controls
43 lines (36 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Java Code Style Check
on:
pull_request:
branches: ['**']
push:
branches: ['**']
workflow_dispatch:
jobs:
style-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
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: Run Spotless and Checkstyle
run: |
set -e
./gradlew spotlessCheck --no-daemon
./gradlew checkstyleMain checkstyleTest --no-daemon
shell: bash
- name: Show summary
run: |
if [ $? -eq 0 ]; then
echo "🎉 Code style checks passed!"
else
echo "❌ Code style violations detected!"
echo "Please run './gradlew spotlessApply' locally and fix Checkstyle issues."
exit 1
fi
shell: bash