Skip to content

Commit 4e99205

Browse files
spacelukeCopilot
andauthored
Update JDK 17 build step to include spotless check (#5486)
* Update JDK 17 build step to include spotless check as msg * Modify build.yml to include code style check Updated build workflow to run code style checks for JDK 17. * Remove formatting step from PR checklist Removed the requirement to run 'mvn spotless:apply' for formatting. * Create separate workflow file for code style check (#5491) * Initial plan * Separate code style check into independent job Co-authored-by: spaceluke <[email protected]> * Add explicit permissions to code-style-check job Co-authored-by: spaceluke <[email protected]> * Move code style check to separate workflow file Co-authored-by: spaceluke <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: spaceluke <[email protected]> * Update copyright year in code-style-check.yml --------- Co-authored-by: Copilot <[email protected]>
1 parent d683dad commit 4e99205

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ Follow this checklist to help us incorporate your contribution quickly and easil
1515
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
1616
- [ ] Write necessary unit tests to verify the code.
1717
- [ ] Run `mvn clean test` to make sure this pull request doesn't break anything.
18+
- [ ] Run `mvn spotless:apply` to format your code.
1819
- [ ] Update the [`CHANGES` log](https://github.com/apolloconfig/apollo/blob/master/CHANGES.md).
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright 2025 Apollo Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# This workflow checks code style using Spotless
17+
18+
name: code style check
19+
20+
on:
21+
push:
22+
branches: [ master ]
23+
pull_request:
24+
branches: [ master ]
25+
26+
jobs:
27+
code-style-check:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Set up JDK 17
34+
uses: actions/setup-java@v1
35+
with:
36+
java-version: 17
37+
- name: Cache Maven packages
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.m2/repository
41+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
42+
restore-keys: |
43+
${{ runner.os }}-maven-
44+
- name: Code Style Check
45+
run: mvn spotless:check

0 commit comments

Comments
 (0)