-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github actions to check Java Import are sorted.
- Loading branch information
1 parent
5c50fcf
commit 362e860
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Check Java Import" | ||
description: "Check Java Import are well sorted with Maven" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Check Java Import | ||
id: sort_import | ||
shell: bash | ||
run: mvn -B impsort:check | ||
|
||
- name: Add comment | ||
if: failure() | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: Java Import check Failed | ||
message: | | ||
:x: **Java Import are not sorted !** [(more details)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
Ensure your code build locally using: | ||
``` | ||
mvn clean install | ||
``` | ||
Or just validate java import with : | ||
``` | ||
mvn impsort:check | ||
``` | ||
You can sort Java import with : | ||
``` | ||
mvn impsort:sort | ||
``` | ||
See also [How configure your IDE](https://github.com/eclipse/leshan/wiki/Code-&-design-guidelines#configure-your-ide). | ||
- name: Delete comment | ||
if: success() | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: Code Formatter Validation Failed | ||
delete: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters