GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pmd/.github/workflows/build.yml at main · pmd/pmd

Expand file tree

/

build.yml

Copy path
View runs
More file actions
More file actions

Latest commit

 

History

History
History
384 lines (368 loc) · 14.7 KB
/

build.yml

Copy path

File metadata and controls

384 lines (368 loc) · 14.7 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
name: Build
on:
workflow_call:
# if another commit is added to the same branch or PR (same github.ref),
# then cancel already running jobs and start a new build.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
env:
LANG: 'en_US.UTF-8'
jobs:
compile:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 #v6.3.0
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
with:
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
path: .m2/repository
enableCrossOsArchive: true
- name: Fast Build with Maven
run: |
./mvnw --show-version --errors --batch-mode \
-Dmaven.repo.local=.m2/repository \
verify -PfastSkip -DskipTests -DskipITs -Dcyclonedx.skip=false \
deploy:deploy -DaltDeploymentRepository="dogfood::file://$(pwd)/target/staging"
- name: Cleanup local repository
run: |
# Cleanup local repository to not poison the shared cache with our SNAPSHOTS of the current build.
# Some information is stored in maven-metadata-*.xml files which tells maven which
# version exactly is available in the staging repo. But if we rerun the build using the
# older cache, it points to the old staging versions, which are not available anymore.
find .m2/repository/net/sourceforge/pmd -type d -name "*-SNAPSHOT" -and -not -path "*/pmd-designer/*" -print0 | xargs -0 rm -vrf
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 #v7.0.2
with:
name: compile-artifact
if-no-files-found: error
path: |
*/target
*/*/target
!pmd-dist/target/pmd-dist-*-bin.zip
!pmd-dist/target/pmd-dist-*-src.zip
!pmd-dist/target/pmd-*-cyclonedx.xml
!pmd-dist/target/pmd-*-cyclonedx.json
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 #v7.0.2
with:
name: staging-repository
if-no-files-found: error
path: target/staging
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 #v7.0.2
with:
name: dist-artifact
if-no-files-found: error
path: |
pmd-dist/target/pmd-dist-*-bin.zip
pmd-dist/target/pmd-dist-*-src.zip
pmd-dist/target/pmd-*-cyclonedx.xml
pmd-dist/target/pmd-*-cyclonedx.json
spelling:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- name: Spell Check Repo
uses: crate-ci/typos@276087d9a4f06398b3e04825487805e2d7375888 #v1.52.2
# note: don't fail the build on typos, just annotate them
# so that publish-pull-requests job still runs.
continue-on-error: true
with:
config: .ci/files/typos.toml
verify:
needs: compile
timeout-minutes: 30
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 #v6.3.0
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
with:
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
path: .m2/repository
enableCrossOsArchive: true
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 #v8.0.2
with:
name: compile-artifact
- name: Full Build with Maven
run: |
./mvnw --show-version --errors --batch-mode \
-Dmaven.repo.local=.m2/repository \
verify -DskipTests -DskipITs
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 #v7.0.2
with:
name: javadocs-artifact
if-no-files-found: error
path: |
*/target/*-javadoc.jar
*/*/target/*-javadoc.jar
verify-unittests:
needs: compile
timeout-minutes: 30
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
# don't fail fast - we want to know the results of all runs
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 #v6.3.0
# under linux we execute more extensive integration tests with various java versions
if: ${{ runner.os == 'Linux' }}
with:
distribution: 'temurin'
java-version: |
8
11
17
25
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 #v6.3.0
# default java version for all os is 21
with:
distribution: 'temurin'
java-version: '21'
# only restore the cache, don't create a new cache
# Note: this works under Windows only if pom.xml files use LF, so that hashFiles('**/pom.xml')
# gives the same result (line endings...).
# see .gitattributes for pom.xml - it should always be using lf.
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
with:
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
path: .m2/repository
enableCrossOsArchive: true
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 #v8.0.2
# we can only reuse compile-artifacts under linux due to file timestamp issues and
# platform specific line endings in test resource files.
if: ${{ runner.os == 'Linux' }}
with:
name: compile-artifact
- name: Build with Maven and run unit and integration tests (linux)
# under linux we execute more extensive integration tests with various java versions
if: ${{ runner.os == 'Linux' }}
run: |
./mvnw --show-version --errors --batch-mode \
-Dmaven.repo.local=.m2/repository \
verify \
-PfastSkip -Dcyclonedx.skip=false \
-Djava8.home="${JAVA_HOME_8_X64}" \
-Djava11.home="${JAVA_HOME_11_X64}" \
-Djava17.home="${JAVA_HOME_17_X64}" \
-Djava25.home="${JAVA_HOME_25_X64}"
- name: Build with Maven and run unit tests
if: ${{ runner.os != 'Linux' }}
run: |
./mvnw --show-version --errors --batch-mode \
-Dmaven.repo.local=.m2/repository \
verify \
-PfastSkip -Dcyclonedx.skip=false
dogfood:
needs: compile
timeout-minutes: 30
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 #v6.3.0
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
with:
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
path: .m2/repository
enableCrossOsArchive: true
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 #v8.0.2
with:
name: compile-artifact
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 #v8.0.2
with:
name: staging-repository
path: target/staging
- name: Run PMD on PMD
run: |
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then
dogfood_name="pr-$(jq -r ".number" "${GITHUB_EVENT_PATH}")"
else
dogfood_name="sha-${GITHUB_SHA}"
fi
current_pmd_version=$(./mvnw --batch-mode --no-transfer-progress \
help:evaluate -Dexpression=project.version -q -DforceStdout || echo "failed_to_determine_current_pmd_version")
echo "Determined current pmd version: ${current_pmd_version}"
new_version="${current_pmd_version}-dogfood-${dogfood_name}-SNAPSHOT"
echo "::group::Set version to ${new_version}"
./mvnw -Dmaven.repo.local=.m2/repository \
versions:set --quiet -DnewVersion="${new_version}" -DgenerateBackupPoms=false
sed -i 's/<version>[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}.*<\/version>\( *<!-- pmd.dogfood.version -->\)/<version>'"${current_pmd_version}"'<\/version>\1/' pom.xml
echo "::endgroup::"
echo "::group::Generate settings.xml to use dogfoodStagingRepo"
maven_settings_file="$(pwd)/target/staging/settings.xml"
cat > "${maven_settings_file}" <<EOF
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>dogfood</id>
<pluginRepositories>
<pluginRepository>
<id>dogfood</id>
<url>file://$(pwd)/target/staging</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
EOF
echo "new file ${maven_settings_file}:"
cat "${maven_settings_file}"
echo "::endgroup::"
echo "::group::Run ./mvnw verify"
./mvnw --show-version --errors --batch-mode \
--settings "${maven_settings_file}" \
-Dmaven.repo.local=.m2/repository \
verify \
-PfastSkip,dogfood \
-DskipTests \
-DskipITs \
-Dpmd.skip=false \
-Dcpd.skip=false
echo "::endgroup::"
echo "::group::Restore version to ${current_pmd_version}"
./mvnw -Dmaven.repo.local=.m2/repository \
versions:set --quiet -DnewVersion="${current_pmd_version}" -DgenerateBackupPoms=false
git checkout -- pom.xml
echo "::endgroup::"
documentation:
needs: compile
timeout-minutes: 30
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 #v6.3.0
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
with:
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
path: .m2/repository
enableCrossOsArchive: true
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 #v8.0.2
with:
name: compile-artifact
- name: Generate rule docs
run: |
./mvnw --show-version --errors --batch-mode \
-Dmaven.repo.local=.m2/repository \
verify \
-Pgenerate-rule-docs,fastSkip \
-DskipTests -DskipITs -Dassembly.skipAssembly=true
- name: Set up Ruby 4
uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 #v1.343.0
with:
ruby-version: 4
- name: Setup bundler
run: |
cd docs
bundle config set --local path vendor/bundle
bundle install
- name: Build documentation
run: |
cd docs
bundle exec jekyll build
- name: Create Markdown formatted Release Notes
run: |
cd docs
bundle exec render_release_notes.rb pages/release_notes.md | tail -n +6 > _site/pmd_release_notes.md
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 #v7.0.2
with:
name: docs-artifact
if-no-files-found: error
path: docs/_site
regressiontester:
needs: compile
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
with:
fetch-depth: 2
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 #v6.3.0
with:
distribution: 'temurin'
java-version: |
11
21
- name: Set up Ruby 4
uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 #v1.343.0
with:
ruby-version: 4
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
with:
path: |
~/.m2/repository
~/.gradle/caches
~/work/pmd/target/repositories
.ci/files/vendor/bundle
key: regressiontester-${{ hashFiles('.ci/files/project-list.xml', '.ci/files/Gemfile.lock') }}
restore-keys: regressiontester-
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 #v8.0.2
with:
name: dist-artifact
path: pmd-dist/target
- name: Setup bundler
run: |
bundle config set --local gemfile .ci/files/Gemfile
bundle config set --local path vendor/bundle
bundle install
- name: Prepare HOME/openjdk11
run: |
ln -sfn "${JAVA_HOME_11_X64}" "${HOME}/openjdk11"
- name: Run pmdtester
env:
# this variable is available for "push" builds only, otherwise it's empty
PMD_REGRESSION_TESTER_PUSH_BEFORE: ${{ github.event.before }}
run: .ci/files/pmdtester_start.sh
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ..)" >> "${GITHUB_ENV}"
- name: Upload regression tester report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 #v7.0.2
with:
name: pmd-regression-tester
if-no-files-found: error
path: ${{ env.artifacts_path }}/target/reports/diff
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.