-
Notifications
You must be signed in to change notification settings - Fork 266
57 lines (49 loc) · 1.47 KB
/
code_quality_check.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Code Quality Check
on:
push:
branches:
- "master"
- "*-rc"
pull_request:
types: [opened, reopened, synchronize]
branches:
- "**"
jobs:
checkstyle-and-spotless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for accurate git commands
- name: Debug Git Output
run: |
echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Committed files in the current branch:"
git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --name-only --pretty=format:
echo "Uncommitted files:"
git diff --name-only
echo "Staged files:"
git diff --cached --name-only
- name: Setup Java & Gradle
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: actions/cache@v4
name: Cache Gradle Wrapper
id: cache-gradle-wrapper
with:
path: |
gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-v1
- name: Get Gradle wrapper
if: steps.cache-gradle-wrapper.outputs.cache-hit != 'true'
run: |
./configure.sh
- name: Run Checkstyle
run: |
./gradlew clean rskj-core:checkstyleMain checkstyleTest
- name: Run Spotless Check
run: |
./gradlew clean rskj-core:spotlessCheck