File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed
Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 6868 id : date
6969 run : echo "::set-output name=week_of_year::$(date +'%W' --utc)"
7070 - uses : actions/checkout@v4
71+ with :
72+ fetch-depth : 0
7173 - uses : actions/setup-java@v4
7274 with :
7375 distribution : temurin
7981 path : ~/.m2/repository
8082 key : ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
8183 - run : java -version
82- - run : mvn -B -ntp com.spotify.fmt:fmt-maven-plugin:check -T 1C
83- - run : mvn -B -ntp checkstyle:check@checkstyle
84+ - run : .kokoro/build.sh
85+ env :
86+ JOB_TYPE : lint
87+ HEAD_BRANCH : ${{ github.head_ref }}
88+ BASE_BRANCH : ${{ github.base_ref }}
8489 enforcer :
8590 runs-on : ubuntu-latest
8691 steps :
Original file line number Diff line number Diff line change @@ -92,6 +92,27 @@ case ${JOB_TYPE} in
9292 echo " Not running GraalVM checks -- No changes in relevant modules"
9393 fi
9494 ;;
95+ lint)
96+ git checkout " ${BASE_BRANCH} "
97+ git checkout " ${HEAD_BRANCH} "
98+ changed_file_list=" $( git diff --name-only " ${BASE_BRANCH} " HEAD) "
99+ has_code_change=" false"
100+ while IFS= read -r changed_file; do
101+ if [ -n " ${changed_file} " ] && [[ " ${changed_file} " == * .java ]]; then
102+ has_code_change=" true"
103+ break
104+ fi
105+ done <<< " ${changed_file_list}"
106+ if [ " ${has_code_change} " == " false" ]; then
107+ echo " No java modules affected. Skipping linter check."
108+ exit 0
109+ fi
110+
111+ mvn -B -ntp \
112+ -T 1.5C \
113+ com.spotify.fmt:fmt-maven-plugin:check
114+ mvn -B -ntp checkstyle:check@checkstyle
115+ ;;
95116 * ) ;;
96117
97118esac
Original file line number Diff line number Diff line change 1818 "matchPackageNames" : [
1919 " /^com.google.cloud:sdk-platform-java-config/"
2020 ]
21+ },
22+ {
23+ "matchPackagePatterns" : [
24+ " ^com.google.cloud:google-cloud-storage" ,
25+ " ^com.google.apis:google-api-services-storage"
26+ ],
27+ "groupName" : " First-party storage dependencies"
2128 }
2229 ],
2330 "includePaths" : [
You can’t perform that action at this time.
0 commit comments