mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-07-31 17:38:33 +00:00
ACS-9835-Improve code quality in alfresco-transform-core (#1116)
This commit is contained in:
48
.github/workflows/ci.yml
vendored
48
.github/workflows/ci.yml
vendored
@@ -38,29 +38,23 @@ jobs:
|
||||
pre_commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.14.1
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: changed-files
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/github-list-changes@v8.14.1
|
||||
with:
|
||||
write-list-to-env: true
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v8.26.0
|
||||
|
||||
veracode_sca:
|
||||
name: "Veracode - Source Clear Scan (SCA)"
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- pre_commit
|
||||
if: >
|
||||
github.ref_name == 'master' ||
|
||||
github.event_name == 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
||||
- name: "Clean-up SNAPSHOT artifacts"
|
||||
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v8.26.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
|
||||
@@ -68,14 +62,16 @@ jobs:
|
||||
veracode_sast:
|
||||
name: "Pipeline SAST Scan"
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- pre_commit
|
||||
if: >
|
||||
(github.ref_name == 'master' || startsWith(github.ref_name, 'SP/') || startsWith(github.ref_name, 'HF/') || github.event_name == 'pull_request') &&
|
||||
github.actor != 'dependabot[bot]' &&
|
||||
!contains(github.event.head_commit.message, '[skip tests]')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
||||
- name: "Login to Docker Hub"
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
@@ -87,7 +83,7 @@ jobs:
|
||||
registry: quay.io
|
||||
username: ${{ secrets.QUAY_USERNAME }}
|
||||
password: ${{ secrets.QUAY_PASSWORD }}
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v8.26.0
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
repository: "Alfresco/veracode-baseline-archive"
|
||||
@@ -141,8 +137,8 @@ jobs:
|
||||
!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@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.26.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
||||
- uses: Alfresco/ya-pmd-scan@v4.1.0
|
||||
with:
|
||||
classpath-build-command: "mvn -ntp package -DskipTests"
|
||||
@@ -150,13 +146,15 @@ jobs:
|
||||
build_and_test:
|
||||
name: "Core & Base Snapshot deployment"
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- pre_commit
|
||||
if: >
|
||||
github.ref_name == 'master' &&
|
||||
github.event_name != 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
||||
- name: "Login to Docker Hub"
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
@@ -186,6 +184,8 @@ jobs:
|
||||
all_tests_matrix:
|
||||
name: ${{ matrix.testName }}
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- pre_commit
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -210,8 +210,8 @@ jobs:
|
||||
testProfile: aio-test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
||||
- name: "Login to Docker Hub"
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
@@ -251,8 +251,8 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.26.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.26.0
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
@@ -274,7 +274,7 @@ jobs:
|
||||
sudo service docker restart
|
||||
- name: "Clean-up SNAPSHOT artifacts"
|
||||
run: find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.14.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.26.0
|
||||
with:
|
||||
username: ${{ env.GIT_USERNAME }}
|
||||
email: ${{ env.GIT_EMAIL }}
|
||||
|
32
.github/workflows/precommit_formatter.yml
vendored
Normal file
32
.github/workflows/precommit_formatter.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Pre-Commit formatter
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- precommit/**
|
||||
|
||||
jobs:
|
||||
format-code:
|
||||
name: "Reformat code"
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(github.event.head_commit.message, '[reformat code]')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ inputs.python-version }}
|
||||
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
|
||||
continue-on-error: true
|
||||
with:
|
||||
extra_args: --all-files
|
||||
- name: Update secrets baseline
|
||||
run: pip install detect-secrets && detect-secrets scan --baseline .secrets.baseline
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.26.0
|
||||
with:
|
||||
username: ${{ secrets.BOT_GITHUB_USERNAME }}
|
||||
add-options: -u
|
||||
commit-message: "Apply Pre-Commit code formatting"
|
||||
skip-if-no-changes: true
|
||||
- name: Push changes
|
||||
run: git push
|
Reference in New Issue
Block a user