2021-04-15 15:26:33 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '**'
|
|
|
|
pull_request:
|
2023-02-26 14:57:39 +01:00
|
|
|
merge_group:
|
2021-04-15 15:26:33 +02:00
|
|
|
schedule:
|
|
|
|
# build it monthly: At 04:00 on day-of-month 1.
|
|
|
|
- cron: '0 4 1 * *'
|
2021-05-06 10:25:28 +02:00
|
|
|
workflow_dispatch:
|
2023-11-16 12:53:38 +01:00
|
|
|
inputs:
|
|
|
|
build_cli_dist_only:
|
|
|
|
description: "Build only modules cli and dist"
|
|
|
|
required: true
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2021-04-15 15:26:33 +02:00
|
|
|
|
2022-09-19 21:02:02 +02:00
|
|
|
permissions:
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
|
2021-04-15 15:26:33 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
2022-09-30 10:48:42 +02:00
|
|
|
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
|
2021-04-15 15:26:33 +02:00
|
|
|
continue-on-error: false
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
|
|
|
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
|
|
|
|
steps:
|
2023-09-11 03:41:17 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-04-16 20:06:56 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2024-01-22 03:44:39 +00:00
|
|
|
- uses: actions/cache@v4
|
2021-04-15 15:26:33 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.m2/repository
|
2021-05-07 16:08:30 +02:00
|
|
|
~/.gradle/caches
|
2021-04-15 15:26:33 +02:00
|
|
|
~/.cache
|
2021-04-24 18:01:17 +02:00
|
|
|
~/work/pmd/target/repositories
|
2021-04-15 16:20:22 +02:00
|
|
|
vendor/bundle
|
2022-03-18 17:04:02 +01:00
|
|
|
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
2021-04-15 15:26:33 +02:00
|
|
|
restore-keys: |
|
2022-03-18 17:04:02 +01:00
|
|
|
v3-${{ runner.os }}-
|
2024-02-15 20:28:34 +01:00
|
|
|
- name: Set up Ruby 3.3
|
2021-05-28 16:57:32 +02:00
|
|
|
uses: ruby/setup-ruby@v1
|
2021-04-15 15:26:33 +02:00
|
|
|
with:
|
2024-02-15 20:28:34 +01:00
|
|
|
ruby-version: 3.3
|
2021-04-15 15:26:33 +02:00
|
|
|
- name: Setup Environment
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
2023-06-24 16:39:27 +02:00
|
|
|
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
2024-09-26 17:01:00 +02:00
|
|
|
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/27/scripts" >> $GITHUB_ENV
|
2021-04-15 15:26:33 +02:00
|
|
|
- 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 && \
|
2021-04-16 16:43:28 +02:00
|
|
|
.ci/$f
|
2021-04-15 15:26:33 +02:00
|
|
|
- name: Build
|
|
|
|
run: .ci/build.sh
|
|
|
|
shell: bash
|
|
|
|
env:
|
2023-11-16 12:53:38 +01:00
|
|
|
BUILD_CLI_DIST_ONLY: ${{ inputs.build_cli_dist_only }}
|
2021-04-15 15:26:33 +02:00
|
|
|
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
|
2021-04-15 16:20:22 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-24 22:04:39 +02:00
|
|
|
- name: Workaround actions/upload-artifact#176
|
|
|
|
run: |
|
|
|
|
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
|
2023-06-24 16:50:14 +02:00
|
|
|
- name: Upload regression tester report
|
2024-01-05 14:51:49 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-06-24 16:50:14 +02:00
|
|
|
with:
|
|
|
|
name: pmd-regression-tester
|
2023-06-24 22:04:39 +02:00
|
|
|
path: ${{ env.artifacts_path }}/target/pr-*-diff-report-*.tar.gz
|
2023-06-24 16:50:14 +02:00
|
|
|
if-no-files-found: ignore
|