Skip to content

Commit e96287e

Browse files
committed
Merge branch 'master' into update-from-template-merged
2 parents ae6bea8 + 251594a commit e96287e

File tree

17 files changed

+1468
-2
lines changed

17 files changed

+1468
-2
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33

44
# Force sh files to have LF
55
*.sh text eol=lf
6+
7+
# Force MVN Wrapper Linux files LF
8+
mvnw text eol=lf
9+
maven-wrapper.properties text eol=lf

.github/.lycheeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Ignorefile for broken link check
22
localhost
3+
mvnrepository.com

.github/workflows/check-build.yml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
name: Check Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths-ignore:
8+
- '**.md'
9+
- '.config/**'
10+
- '.github/**'
11+
- '.idea/**'
12+
- 'assets/**'
13+
pull_request:
14+
branches: [ develop ]
15+
paths-ignore:
16+
- '**.md'
17+
- '.config/**'
18+
- '.github/**'
19+
- '.idea/**'
20+
- 'assets/**'
21+
22+
env:
23+
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 30
29+
strategy:
30+
matrix:
31+
java: [17, 21]
32+
distribution: [temurin]
33+
steps:
34+
- uses: actions/checkout@v5
35+
36+
- name: Set up JDK
37+
uses: actions/setup-java@v5
38+
with:
39+
distribution: ${{ matrix.distribution }}
40+
java-version: ${{ matrix.java }}
41+
42+
- name: Cache Maven
43+
uses: actions/cache@v4
44+
with:
45+
path: ~/.m2/repository
46+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
47+
restore-keys: |
48+
${{ runner.os }}-mvn-build-
49+
50+
- name: Build with Maven
51+
run: ./mvnw -B clean package
52+
53+
- name: Check for uncommited changes
54+
run: |
55+
if [[ "$(git status --porcelain)" != "" ]]; then
56+
echo ----------------------------------------
57+
echo git status
58+
echo ----------------------------------------
59+
git status
60+
echo ----------------------------------------
61+
echo git diff
62+
echo ----------------------------------------
63+
git diff
64+
echo ----------------------------------------
65+
echo Troubleshooting
66+
echo ----------------------------------------
67+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
68+
exit 1
69+
fi
70+
71+
- name: Upload demo files
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: demo-files-java-${{ matrix.java }}
75+
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
76+
if-no-files-found: error
77+
78+
checkstyle:
79+
runs-on: ubuntu-latest
80+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
81+
timeout-minutes: 15
82+
strategy:
83+
matrix:
84+
java: [17]
85+
distribution: [temurin]
86+
steps:
87+
- uses: actions/checkout@v5
88+
89+
- name: Set up JDK
90+
uses: actions/setup-java@v5
91+
with:
92+
distribution: ${{ matrix.distribution }}
93+
java-version: ${{ matrix.java }}
94+
95+
- name: Cache Maven
96+
uses: actions/cache@v4
97+
with:
98+
path: ~/.m2/repository
99+
key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
100+
restore-keys: |
101+
${{ runner.os }}-mvn-checkstyle-
102+
103+
- name: CheckStyle Cache
104+
uses: actions/cache@v4
105+
with:
106+
path: '**/target/checkstyle-cachefile'
107+
key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
108+
restore-keys: |
109+
${{ runner.os }}-checkstyle-
110+
111+
- name: Run Checkstyle
112+
run: ./mvnw -B checkstyle:check -P checkstyle -T2C
113+
114+
pmd:
115+
runs-on: ubuntu-latest
116+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
117+
timeout-minutes: 15
118+
strategy:
119+
matrix:
120+
java: [17]
121+
distribution: [temurin]
122+
steps:
123+
- uses: actions/checkout@v5
124+
125+
- name: Set up JDK
126+
uses: actions/setup-java@v5
127+
with:
128+
distribution: ${{ matrix.distribution }}
129+
java-version: ${{ matrix.java }}
130+
131+
- name: Cache Maven
132+
uses: actions/cache@v4
133+
with:
134+
path: ~/.m2/repository
135+
key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
136+
restore-keys: |
137+
${{ runner.os }}-mvn-pmd-
138+
139+
- name: PMD Cache
140+
uses: actions/cache@v4
141+
with:
142+
path: '**/target/pmd/pmd.cache'
143+
key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
144+
restore-keys: |
145+
${{ runner.os }}-pmd-
146+
147+
- name: Run PMD
148+
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C
149+
150+
- name: Run CPD (Copy Paste Detector)
151+
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
152+
153+
- name: Upload report
154+
if: always()
155+
uses: actions/upload-artifact@v4
156+
with:
157+
name: pmd-report
158+
if-no-files-found: ignore
159+
path: |
160+
target/reports/**

0 commit comments

Comments
 (0)