-
Notifications
You must be signed in to change notification settings - Fork 3
151 lines (134 loc) · 4.05 KB
/
check-build.yml
File metadata and controls
151 lines (134 loc) · 4.05 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Check Build
on:
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
java: [21]
distribution: [temurin]
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- name: Cache Gradle
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-build-
- name: Build
run: ./gradlew build buildPlugin --info --stacktrace
- name: Try upload test reports when failure occurs
uses: actions/upload-artifact@v6
if: failure()
with:
name: test-reports-${{ matrix.java }}
path: build/reports/tests/test/**
- name: Check for uncommited changes
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo ----------------------------------------
echo git status
echo ----------------------------------------
git status
echo ----------------------------------------
echo git diff
echo ----------------------------------------
git diff
echo ----------------------------------------
echo Troubleshooting
echo ----------------------------------------
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package"
exit 1
fi
- name: Upload plugin files
uses: actions/upload-artifact@v6
with:
name: plugin-files-java-${{ matrix.java }}
path: build/distributions/*.zip
if-no-files-found: error
checkstyle:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15
strategy:
matrix:
java: [21]
distribution: [temurin]
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- name: Cache Gradle
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-checkstyle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-checkstyle-
- name: Run Checkstyle
run: ./gradlew checkstyleMain checkstyleTest -PcheckstyleEnabled --stacktrace
pmd:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15
strategy:
matrix:
java: [21]
distribution: [temurin]
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- name: Run PMD
run: ./gradlew pmdMain pmdTest -PpmdEnabled --stacktrace -x test
- name: Cache Gradle
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-pmd-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-pmd-
- name: Upload report
if: always()
uses: actions/upload-artifact@v6
with:
name: pmd-report
if-no-files-found: ignore
path: |
build/reports/pmd/*.html