-
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 for code format/style check.
- Loading branch information
1 parent
5c8e55f
commit 33a1c7c
Showing
5 changed files
with
89 additions
and
1 deletion.
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,36 @@ | ||
name: "CheckSyle Validation" | ||
description: "Check some code style rules with Maven" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Check Code Style | ||
id: checkstyle | ||
shell: bash | ||
run: mvn -B checkstyle:checkstyle | ||
|
||
- name: Add comment | ||
if: failure() | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: Checkstyle Validation Failed | ||
message: | | ||
:x: **Checkstyle Validation Failed !** [(more details)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
Ensure your code build locally using: | ||
``` | ||
mvn clean install | ||
``` | ||
Or just validate checkstyle rules with : | ||
``` | ||
mvn checkstyle:checkstyle | ||
``` | ||
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: Checkstyle 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Check code Format" | ||
description: "Check code is well formatted with Maven" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Check Code Format | ||
id: formatter | ||
shell: bash | ||
run: mvn -B formatter:validate | ||
|
||
- name: Add comment | ||
if: failure() | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: Code Formatter Validation Failed | ||
message: | | ||
:x: **Code is not well-formatted !** [(more details)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
Ensure your code build locally using: | ||
``` | ||
mvn clean install | ||
``` | ||
Or just validate code format with : | ||
``` | ||
mvn formatter:validate | ||
``` | ||
You can format the code with : | ||
``` | ||
mvn formatter:format | ||
``` | ||
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
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