-
-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (101 loc) · 3.37 KB
/
main.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Java Prettier: https://github.com/marketplace/actions/prettier-java-action
# Java Checkstyle: https://github.com/marketplace/actions/run-java-checkstyle
# Prettier: https://github.com/marketplace/actions/prettier-action
# Lint Action: https://github.com/marketplace/actions/lint-action#supported-tools
# HTML5 Validator: https://github.com/marketplace/actions/html5-validator
name: Continuous Integration
on:
pull_request:
branches: [ master ]
jobs:
### Format Java ###
java-prettify:
name: Format Java
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 12
- name: Prettify Java code
uses: lwerner-lshigh/[email protected]
with:
prettier_options: --write **/*.java
branch: ${{ github.head_ref }}
commit_message: 'Bot: Prettified Java code!'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
### Lint Java ###
java-checkstyle:
needs: java-prettify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 12
- name: Run Java checkstyle
uses: nikitasavinov/checkstyle-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
checkstyle_config: google_checks_mod.xml
filter_mode: nofilter
fail_on_error: true
workdir: src/com/omegarobotics # working dir relative to root dir
################ Format ###################
### HTML, CSS, SCSS, JS, JSON, MD, YAML ###
###########################################
prettier:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Run Prettier
uses: creyD/[email protected]
with:
### Prettier Options ###
# --write prettifies directory/file given
# in this case, everything is prettified (if supported)
prettier_options: --write .
commit_message: 'Bot: Prettified code!'
### Lint CSS, SCSS ###
stylelint:
needs: prettier
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install stylelint-config-sass-guidelines
run: npm install --save stylelint-config-sass-guidelines
- name: Install stylelint
run: npm install --save-dev stylelint stylelint-config-standard
- name: Run stylelint
uses: samuelmeuli/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
stylelint: true # Enables stylelint on Lint Action
auto_fix: true # Enables auto fix (Lint Action will auto commit)
### Lint HTML ###
validate-html:
needs: prettier
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Run HTML5 Validator (also check CSS)
uses: Cyb3r-Jak3/[email protected]
with:
root: .
- name: Retrieve log file
uses: actions/upload-artifact@v2
with:
name: log
path: log.log