-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (86 loc) · 2.65 KB
/
build.yml
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
name: build
on:
push:
branches:
- main
- master
tags:
- '**'
pull_request:
merge_group:
schedule:
# build it monthly: At 04:00 on day-of-month 1.
- cron: '0 4 1 * *'
workflow_dispatch:
inputs:
build_cli_dist_only:
description: "Build only modules cli and dist"
required: true
type: boolean
default: false
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
# read to fetch code (actions/checkout)
# write to push code to gh-pages, create releases
# note: forked repositories will have maximum read access
contents: write
continue-on-error: false
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gradle/caches
~/.cache
~/work/pmd/target/repositories
vendor/bundle
# avoid caching missed dependencies
!~/.m2/repository/**/*.lastUpdated
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v3-${{ runner.os }}-
- name: Set up Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/24/scripts" >> $GITHUB_ENV
- name: Check Environment
shell: bash
run: |
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
- name: Build
run: .ci/build.sh
shell: bash
env:
BUILD_CLI_DIST_ONLY: ${{ inputs.build_cli_dist_only }}
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
- name: Upload regression tester report
uses: actions/upload-artifact@v4
with:
name: pmd-regression-tester
path: ${{ env.artifacts_path }}/target/pr-*-diff-report-*.tar.gz
if-no-files-found: ignore