Skip to content

Commit 9fb2fa2

Browse files
author
Roman Glushko
committed
#184 Made pmd and stopbugs process PR changelog
1 parent 6b16e74 commit 9fb2fa2

File tree

3 files changed

+64
-7
lines changed

3 files changed

+64
-7
lines changed

.github/workflows/gradle.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ jobs:
3131
env:
3232
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}
3333
- name: Run PMD Quality Check
34-
run: ./gradlew pmdMain -i
34+
run: ./gradlew pmdCI -i
35+
env:
36+
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}
3537
- name: Run Spotbugs Quality Check
36-
run: ./gradlew spotbugsMain -i
38+
run: ./gradlew spotbugsCI -i
3739

3840
build-windows:
3941

@@ -59,9 +61,11 @@ jobs:
5961
TARGET_BRANCH: ${{ github.base_ref }}
6062
WORKING_BRANCH: ${{ github.head_ref }}
6163
- name: Run PMD Quality Check
62-
run: ./gradlew pmdMain -i
64+
run: ./gradlew pmdCI -i
65+
env:
66+
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}
6367
- name: Run Spotbugs Quality Check
64-
run: ./gradlew spotbugsMain -i
68+
run: ./gradlew spotbugsCI -i
6569

6670
build-macos:
6771

@@ -89,6 +93,8 @@ jobs:
8993
TARGET_BRANCH: ${{ github.base_ref }}
9094
WORKING_BRANCH: ${{ github.head_ref }}
9195
- name: Run PMD Quality Check
92-
run: ./gradlew pmdMain -i
96+
run: ./gradlew pmdCI -i
97+
env:
98+
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}
9399
- name: Run Spotbugs Quality Check
94-
run: ./gradlew spotbugsMain -i
100+
run: ./gradlew spotbugsCI -i

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ plugins {
1010
id "com.github.spotbugs" version "3.0.0"
1111
}
1212

13+
ext {
14+
SpotBugsTask = com.github.spotbugs.SpotBugsTask
15+
}
16+
1317
repositories {
1418
mavenCentral()
1519
}

gradle-tasks/staticChecks.gradle

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,53 @@ task checkstyleCI(type: Checkstyle) {
5757
include changedFiles
5858
}
5959

60+
tasks.withType(Pmd) {
61+
// Specify all files that should be checked
62+
classpath = files()
63+
source "${project.rootDir}"
64+
65+
reports {
66+
xml.enabled false
67+
html.enabled true
68+
}
69+
}
70+
71+
// Execute Checkstyle on all files
72+
task pmd(type: Pmd) {
73+
}
74+
75+
// Execute Checkstyle on all modified files
76+
task pmdCI(type: Pmd) {
77+
def changedFiles = getChangedFiles()
78+
include changedFiles
79+
}
80+
81+
tasks.withType(SpotBugsTask) {
82+
// Specify all files that should be checked
83+
classpath = files()
84+
source "${project.rootDir}"
85+
86+
reports {
87+
xml.enabled false
88+
html.enabled true
89+
}
90+
}
91+
92+
task compileJava(overwrite: true) {
93+
dependsOn 'compileDebugJavaWithJavac'
94+
group = "build"
95+
}
96+
97+
// Execute SpotBugsTask on all files
98+
task spotbugs(type: SpotBugsTask) {
99+
}
100+
101+
// Execute Checkstyle on all modified files
102+
task spotbugsCI(type: SpotBugsTask) {
103+
def changedFiles = getChangedFiles()
104+
include changedFiles
105+
}
106+
60107
/**
61108
* Get all files that are changed but not deleted nor renamed.
62109
* Compares to master or the specified target branch.
@@ -66,7 +113,7 @@ task checkstyleCI(type: Checkstyle) {
66113
def getChangedFiles() {
67114
def modifiedFilesJson = System.getenv("MODIFIED_FILES")
68115
List<String> files = new ArrayList<>()
69-
116+
70117
if (modifiedFilesJson == null) {
71118
return files
72119
}

0 commit comments

Comments
 (0)