Skip to content

Commit e87530e

Browse files
tiagosalvado10gerardolenskitpage-alfrescodamianujmakmagdziarz
authored
Update CI (#3355)
* ACS-9419 Reformat code and add pre-commit checks to CI (cherry picked from commit 94b927e) * Skip PMD scan for Dependabot updates. (#3085) * Skip PMD scan for Dependabot updates. * Update secrets baseline. (cherry picked from commit 1e599ec) * Use larger runners on ES testing jobs (#3248) (cherry picked from commit 5484294) * [ACS-10977] Please [release] Alfresco Content Services 26.1 M.2 [skip tests] (#3316) (cherry picked from commit 2a3d12b) * remove merge-disk-volumes * pre-commit * pre-commit * Attempt to fix: single_pipeline_image_tests --------- Co-authored-by: Gerard Olenski <gerard.olenski@hyland.com> Co-authored-by: Tom Page <tpage-alfresco@users.noreply.github.com> Co-authored-by: Damian Ujma <92095156+damianujma@users.noreply.github.com> Co-authored-by: Kacper Magdziarz <95610011+kmagdziarz@users.noreply.github.com> Co-authored-by: Tiago Salvado <tiagosalvado10gmail.com>
1 parent 2dad6ea commit e87530e

9 files changed

Lines changed: 1023 additions & 74 deletions

File tree

.github/workflows/arm64.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
workflow_dispatch:
77

88
env:
9+
JAVA_VERSION: "17"
910
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60
1011
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
1112
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
@@ -25,9 +26,11 @@ jobs:
2526
with:
2627
persist-credentials: false
2728
fetch-depth: 0
28-
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.13.0
29-
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.13.0
30-
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.13.0
29+
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v12.4.3
30+
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v12.4.3
31+
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v12.4.3
32+
with:
33+
java-version: ${{ env.JAVA_VERSION }}
3134
- name: Set up QEMU
3235
uses: docker/setup-qemu-action@v3
3336
with:
@@ -85,7 +88,7 @@ jobs:
8588
python3 -m pytest --configuration ../tests/pipeline-all-amps/repo/target/dtas/dtas-config.json tests/ -s
8689
- name: "Dump all Docker containers logs"
8790
if: failure() && (steps.setup-env.outcome == 'failure' || steps.run-tests.outcome == 'failure')
88-
uses: Alfresco/alfresco-build-tools/.github/actions/docker-dump-containers-logs@v8.13.0
91+
uses: Alfresco/alfresco-build-tools/.github/actions/docker-dump-containers-logs@v12.4.3
8992
- name: "Persist test failure flag"
9093
id: persist_test_failure_flag
9194
if: failure()

.github/workflows/ci.yml

Lines changed: 100 additions & 54 deletions
Large diffs are not rendered by default.

.github/workflows/master_release.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- cron: '0 5 * * 3'
1010

1111
env:
12+
JAVA_VERSION: "17"
1213
AWS_REGION: eu-west-1
1314
GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }}
1415
GIT_EMAIL: ${{ secrets.BOT_GITHUB_EMAIL }}
@@ -47,9 +48,11 @@ jobs:
4748
- uses: actions/checkout@v4
4849
with:
4950
persist-credentials: false
50-
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.13.0
51-
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.13.0
52-
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.13.0
51+
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v12.4.3
52+
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v12.4.3
53+
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v12.4.3
54+
with:
55+
java-version: ${{ env.JAVA_VERSION }}
5356
- name: Set up QEMU
5457
uses: docker/setup-qemu-action@v3
5558
with:
@@ -85,9 +88,11 @@ jobs:
8588
- uses: actions/checkout@v4
8689
with:
8790
persist-credentials: false
88-
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.13.0
89-
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.13.0
90-
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.13.0
91+
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v12.4.3
92+
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v12.4.3
93+
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v12.4.3
94+
with:
95+
java-version: ${{ env.JAVA_VERSION }}
9196
- uses: actions/setup-python@v5
9297
- name: Set up QEMU
9398
uses: docker/setup-qemu-action@v3
@@ -98,7 +103,7 @@ jobs:
98103
run: |
99104
bash ./scripts/ci/init.sh
100105
bash ./scripts/ci/build.sh -m
101-
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.13.0
106+
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v12.4.3
102107
with:
103108
username: ${{ env.GIT_USERNAME }}
104109
email: ${{ env.GIT_EMAIL }}
@@ -143,12 +148,14 @@ jobs:
143148
with:
144149
persist-credentials: false
145150
fetch-depth: 0
146-
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.13.0
147-
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.13.0
148-
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.13.0
151+
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v12.4.3
152+
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v12.4.3
153+
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v12.4.3
154+
with:
155+
java-version: ${{ env.JAVA_VERSION }}
149156
- name: "Init"
150157
run: bash ./scripts/ci/init.sh
151-
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.13.0
158+
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v12.4.3
152159
with:
153160
username: ${{ env.GIT_USERNAME }}
154161
email: ${{ env.GIT_EMAIL }}
@@ -186,12 +193,14 @@ jobs:
186193
- uses: actions/checkout@v4
187194
with:
188195
persist-credentials: false
189-
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.13.0
190-
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.13.0
191-
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.13.0
196+
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v12.4.3
197+
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v12.4.3
198+
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v12.4.3
199+
with:
200+
java-version: ${{ env.JAVA_VERSION }}
192201
- name: "Init"
193202
run: bash ./scripts/ci/init.sh
194-
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.13.0
203+
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v12.4.3
195204
with:
196205
username: ${{ env.GIT_USERNAME }}
197206
email: ${{ env.GIT_EMAIL }}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Pre-Commit formatter
2+
3+
on:
4+
push:
5+
branches:
6+
- precommit/**
7+
8+
env:
9+
JAVA_VERSION: "17"
10+
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
11+
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
12+
13+
jobs:
14+
format-code:
15+
name: "Reformat code"
16+
runs-on: ubuntu-latest
17+
if: contains(github.event.head_commit.message, '[reformat code]')
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v12.4.3
21+
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v12.4.3
22+
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v12.4.3
23+
with:
24+
java-version: ${{ env.JAVA_VERSION }}
25+
- name: Set up Python ${{ inputs.python-version }}
26+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
27+
with:
28+
python-version: "3.9"
29+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
30+
continue-on-error: true
31+
with:
32+
extra_args: --all-files
33+
- name: Update secrets baseline
34+
run: pip install detect-secrets && detect-secrets scan --baseline .secrets.baseline
35+
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v12.4.3
36+
with:
37+
username: ${{ secrets.BOT_GITHUB_USERNAME }}
38+
add-options: -u
39+
commit-message: "Apply Pre-Commit code formatting"
40+
skip-if-no-changes: true
41+
- name: Push changes
42+
run: git push

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/Yelp/detect-secrets
3+
rev: v1.5.0
4+
hooks:
5+
- id: detect-secrets
6+
args: ["--baseline", ".secrets.baseline"]
7+
- repo: local
8+
hooks:
9+
- id: check-format-and-headers
10+
name: Check format and headers and fix if necessary
11+
entry: ./scripts/hooks/check-format-and-headers.sh
12+
language: script
13+
files: ".*.java"
14+
pass_filenames: false

0 commit comments

Comments
 (0)