2021-04-15 15:26:33 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
- '**'
|
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
# build it monthly: At 04:00 on day-of-month 1.
|
|
|
|
- cron: '0 4 1 * *'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
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@v2
|
2021-04-16 20:06:56 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2021-04-15 15:26:33 +02:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.m2/repository
|
|
|
|
~/.cache
|
2021-04-15 16:20:22 +02:00
|
|
|
vendor/bundle
|
2021-04-15 15:26:33 +02:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-
|
|
|
|
- name: Set up Ruby 2.7
|
|
|
|
uses: actions/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
ruby-version: 2.7
|
|
|
|
- name: Setup Environment
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
2021-04-15 16:20:22 +02:00
|
|
|
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
2021-04-15 15:26:33 +02:00
|
|
|
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/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 && \
|
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:
|
|
|
|
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
|
2021-04-15 16:20:22 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|