Add PMD and precommit for format and license header checking. (#1017)

Use package goal as project doesn't support earlier lifecycle phases.
This commit is contained in:
Tom Page
2024-09-27 10:12:51 +01:00
committed by GitHub
parent abd85fbfe6
commit 87d68cb06d
6 changed files with 653 additions and 0 deletions
+31
View File
@@ -35,6 +35,22 @@ env:
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60
jobs:
pre_commit:
runs-on: ubuntu-latest
outputs:
java_version: ${{ env.JAVA_VERSION }}
java_version_supported_by_repo: ${{ env.JAVA_VERSION_SUPPORTED_BY_REPO }}
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: changed-files
uses: Alfresco/alfresco-build-tools/.github/actions/github-list-changes@v7.0.0
with:
write-list-to-env: true
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v7.0.0
veracode_sca:
name: "Veracode - Source Clear Scan (SCA)"
runs-on: ubuntu-latest
@@ -119,6 +135,21 @@ jobs:
name: Veracode Pipeline-Scan Results (Human Readable)
path: readable_output.zip
pmd_scan:
name: "PMD Scan"
runs-on: ubuntu-latest
if: >
github.event_name == 'pull_request' &&
!contains(github.event.head_commit.message, '[skip pmd]') &&
!contains(github.event.head_commit.message, '[skip tests]')
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0
- uses: Alfresco/ya-pmd-scan@v4.1.0
with:
classpath-build-command: "mvn -ntp package -DskipTests"
build_and_test:
name: "Core & Base Snapshot deployment"
runs-on: ubuntu-latest