-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjava.yml
More file actions
52 lines (44 loc) · 1.64 KB
/
java.yml
File metadata and controls
52 lines (44 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Uses: https://github.com/marketplace/actions/prettier-java-action
# Auto formats code using Prettier
# Uses: https://github.com/marketplace/actions/run-java-checkstyle
# Submits review annotations based on checkstyle errors
name: Java Style
on: pull_request
jobs:
prettify:
name: Prettify Java
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prettify the Java code
uses: lwerner-lshigh/prettier_action_java@v1.1.1
with:
### Prettier Options ###
# --no-semi overrides prettier printing semicolons
# at the ends of all statements
# --tab-width 4 sets the tab width to 4 spaces
# --write *.java formats all .java files
prettier_options: '--no-semi --tab-width 4 --write **/*.java'
branch: ${{ github.head_ref }}
commit_message: 'Bot: Prettified Java code!'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
checkstyle:
name: Java Checkstyle
runs-on: ubuntu-latest
needs: prettify
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Run checkstyle with reviewdog
uses: nikitasavinov/checkstyle-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review # submit review comments based on reviewdog findings
filter_mode: file # report on anything that is in an added/modified file
fail_on_error: true
checkstyle_config: google_checks_mod.xml
workdir: src/com/codefortomorrow # working dir relative to root dir