-
Notifications
You must be signed in to change notification settings - Fork 10
38 lines (36 loc) · 1.23 KB
/
tests.yaml
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
name: Tests
on:
push:
paths-ignore: ['*.md', 'CODEOWNERS', 'LICENSE']
branches:
- 'main'
- 'release/*'
pull_request:
paths-ignore: ['*.md', 'CODEOWNERS', 'LICENSE']
jobs:
# Runs the pom sorter and code formatter to ensure that the code
# is formatted and poms are sorted according to project rules. This
# will fail if the formatter makes any changes.
check-code-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-format-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-format-
${{ runner.os }}-maven-
- name: Format code
run: |
mvn -V -B -e clean formatter:format sortpom:sort -Pautoformat
git status
git diff-index --quiet HEAD || (echo "Error! There are modified files after formatting." && false)
env:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true"