Skip to content

Commit 1e6b237

Browse files
committed
Merge branch 'master' into update-from-template-xdev-software/java-template-merged
2 parents 8f55cca + 32bfc81 commit 1e6b237

26 files changed

+1465
-28
lines changed

.github/workflows/check-build.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 30
26+
strategy:
27+
matrix:
28+
java: [21]
29+
distribution: [temurin]
30+
steps:
31+
- uses: actions/checkout@v5
32+
33+
- name: Set up JDK
34+
uses: actions/setup-java@v5
35+
with:
36+
distribution: ${{ matrix.distribution }}
37+
java-version: ${{ matrix.java }}
38+
39+
- name: Cache Gradle
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.gradle/caches
44+
~/.gradle/wrapper
45+
key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
46+
restore-keys: |
47+
${{ runner.os }}-gradle-build-
48+
49+
- name: Build
50+
run: ./gradlew build buildPlugin --info --stacktrace
51+
52+
- name: Try upload test reports when failure occurs
53+
uses: actions/upload-artifact@v4
54+
if: failure()
55+
with:
56+
name: test-reports-${{ matrix.java }}
57+
path: build/reports/tests/test/**
58+
59+
- name: Check for uncommited changes
60+
run: |
61+
if [[ "$(git status --porcelain)" != "" ]]; then
62+
echo ----------------------------------------
63+
echo git status
64+
echo ----------------------------------------
65+
git status
66+
echo ----------------------------------------
67+
echo git diff
68+
echo ----------------------------------------
69+
git diff
70+
echo ----------------------------------------
71+
echo Troubleshooting
72+
echo ----------------------------------------
73+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package"
74+
exit 1
75+
fi
76+
77+
- name: Upload plugin files
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: plugin-files-java-${{ matrix.java }}
81+
path: build/libs/template-placeholder-*.jar
82+
if-no-files-found: error
83+
84+
checkstyle:
85+
runs-on: ubuntu-latest
86+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
87+
timeout-minutes: 15
88+
strategy:
89+
matrix:
90+
java: [21]
91+
distribution: [temurin]
92+
steps:
93+
- uses: actions/checkout@v5
94+
95+
- name: Set up JDK
96+
uses: actions/setup-java@v5
97+
with:
98+
distribution: ${{ matrix.distribution }}
99+
java-version: ${{ matrix.java }}
100+
101+
- name: Cache Gradle
102+
uses: actions/cache@v4
103+
with:
104+
path: |
105+
~/.gradle/caches
106+
~/.gradle/wrapper
107+
key: ${{ runner.os }}-gradle-checkstyle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
108+
restore-keys: |
109+
${{ runner.os }}-gradle-checkstyle-
110+
111+
- name: Run Checkstyle
112+
run: ./gradlew checkstyleMain checkstyleTest -PcheckstyleEnabled --stacktrace
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: [21]
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: Run PMD
132+
run: ./gradlew pmdMain pmdTest -PpmdEnabled --stacktrace -x test
133+
134+
- name: Cache Gradle
135+
uses: actions/cache@v4
136+
with:
137+
path: |
138+
~/.gradle/caches
139+
~/.gradle/wrapper
140+
key: ${{ runner.os }}-gradle-pmd-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
141+
restore-keys: |
142+
${{ runner.os }}-gradle-pmd-
143+
144+
- name: Upload report
145+
if: always()
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: pmd-report
149+
if-no-files-found: ignore
150+
path: |
151+
build/reports/pmd/*.html
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Check IDE Compatibility
2+
3+
on:
4+
schedule:
5+
- cron: '55 8 * * 1'
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-ide-compatibility:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 45
12+
steps:
13+
- name: Free up disk space
14+
run: |
15+
sudo df -h
16+
declare -a paths_to_wipe=(
17+
"/usr/share/dotnet"
18+
"/usr/local/.ghcup"
19+
"/usr/local/swift"
20+
"/usr/share/swift"
21+
"/usr/lib/jvm"
22+
"/usr/local/lib/android"
23+
"/usr/lib/google-cloud-sdk"
24+
"/usr/local/share/boost"
25+
"/usr/local/share/powershell"
26+
"/usr/local/share/chromium"
27+
"/usr/local/lib/node_modules"
28+
"/usr/lib/mono"
29+
"/usr/lib/heroku"
30+
"/usr/lib/firefox"
31+
"/usr/share/miniconda"
32+
"/opt/microsoft"
33+
"/opt/chrome"
34+
"/opt/pipx"
35+
"$AGENT_TOOLSDIRECTORY"
36+
)
37+
for p in "${paths_to_wipe[@]}"
38+
do
39+
echo "Clearing $p"
40+
sudo rm -rf $p || true
41+
done
42+
sudo df -h
43+
44+
- uses: actions/checkout@v5
45+
46+
- name: Set up JDK
47+
uses: actions/setup-java@v5
48+
with:
49+
distribution: 'temurin'
50+
java-version: 21
51+
52+
- name: Cache Gradle
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
~/.gradle/caches
57+
~/.gradle/wrapper
58+
key: ${{ runner.os }}-gradle-ide-compatibility-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
59+
restore-keys: |
60+
${{ runner.os }}-gradle-ide-compatibility-
61+
62+
- name: Check compatibility
63+
id: check-compatibility
64+
run: ./gradlew verifyPlugin --info --stacktrace
65+
66+
- name: Upload report
67+
uses: actions/upload-artifact@v4
68+
if: ${{ always() }}
69+
with:
70+
name: plugin-verifier-reports
71+
path: build/reports/pluginVerifier/**
72+
if-no-files-found: warn
73+
74+
- name: Find already existing issue
75+
id: find-issue
76+
if: ${{ always() }}
77+
run: |
78+
echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title "IDE Compatibility Problem"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
79+
env:
80+
GH_TOKEN: ${{ github.token }}
81+
82+
- name: Close issue if everything is fine
83+
if: ${{ success() && steps.find-issue.outputs.number != '' }}
84+
run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
85+
env:
86+
GH_TOKEN: ${{ github.token }}
87+
88+
- name: Create issue report
89+
if: ${{ failure() && steps.check-compatibility.conclusion == 'failure' }}
90+
run: |
91+
echo 'Encountered problems during plugin verification' > reported.md
92+
echo 'Please check the build logs for details' >> reported.md
93+
94+
- name: Create Issue From File
95+
if: ${{ failure() && steps.check-compatibility.conclusion == 'failure' }}
96+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
97+
with:
98+
issue-number: ${{ steps.find-issue.outputs.number }}
99+
title: IDE Compatibility Problem
100+
content-filepath: ./reported.md
101+
labels: bug, automated

0 commit comments

Comments
 (0)