Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
id: date
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
Expand All @@ -79,8 +81,11 @@ jobs:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
- run: java -version
- run: mvn -B -ntp com.spotify.fmt:fmt-maven-plugin:check -T 1C
- run: mvn -B -ntp checkstyle:check@checkstyle
- run: .kokoro/build.sh
env:
JOB_TYPE: lint
HEAD_BRANCH: ${{ github.head_ref }}
BASE_BRANCH: ${{ github.base_ref }}
enforcer:
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 21 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,27 @@ case ${JOB_TYPE} in
echo "Not running GraalVM checks -- No changes in relevant modules"
fi
;;
lint)
git checkout "${BASE_BRANCH}"
git checkout "${HEAD_BRANCH}"
changed_file_list="$(git diff --name-only "${BASE_BRANCH}" HEAD)"
has_code_change="false"
while IFS= read -r changed_file; do
if [ -n "${changed_file}" ] && [[ "${changed_file}" == *.java ]]; then
has_code_change="true"
break
fi
done <<< "${changed_file_list}"
if [ "${has_code_change}" == "false" ]; then
echo "No java modules affected. Skipping linter check."
exit 0
fi

mvn -B -ntp \
-T 1.5C \
com.spotify.fmt:fmt-maven-plugin:check
mvn -B -ntp checkstyle:check@checkstyle
;;
*) ;;

esac
Expand Down
Loading