Skip to content

Commit 3acfa15

Browse files
ci: Use reusable workflow for integration tests
1 parent 86c4fee commit 3acfa15

File tree

77 files changed

+53
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+53
-295
lines changed

.github/workflows/manual-run.yml

Lines changed: 9 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,12 @@ on:
1616

1717
jobs:
1818
integration-tests:
19-
name: Integration Tests
20-
runs-on: self-hosted
21-
steps:
22-
- uses: jahia/jahia-modules-action/helper@v2
23-
- uses: actions/checkout@v4
24-
- uses: KengoTODA/actions-setup-docker-compose@main
25-
with:
26-
version: "1.29.2"
27-
- uses: actions/setup-node@v4
28-
with:
29-
node-version: "lts/*"
30-
- uses: jahia/jahia-modules-action/integration-tests@v2
31-
with:
32-
module_id: javascript-modules-engine
33-
tests_path: "javascript-modules-engine/tests/"
34-
testrail_project: Javascript Modules Engine
35-
tests_manifest: ${{ github.event.inputs.manifest }}
36-
jahia_image: ${{ github.event.inputs.jahia_image }}
37-
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
38-
should_use_build_artifacts: false
39-
github_artifact_name: js-eng-${{ github.run_number }}
40-
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
41-
docker_registries: |
42-
[
43-
{
44-
"registry": "ghcr.io",
45-
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
46-
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
47-
},
48-
{
49-
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
50-
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
51-
}
52-
]
53-
nexus_username: ${{ secrets.NEXUS_USERNAME }}
54-
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
55-
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
56-
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
57-
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
58-
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
59-
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
60-
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
61-
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
62-
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
63-
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
64-
- name: Test Report
65-
uses: dorny/test-reporter@v1
66-
if: success() || failure()
67-
with:
68-
name: Tests Report (Standalone)
69-
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
70-
reporter: java-junit
71-
fail-on-error: "false"
72-
env:
73-
# During manual tests, the prepackaged site is fetched from a Maven repository.
74-
# For test executions using built artifacts, a local prepackaged archive is used (moved to the ./artifacts/ folder during the build).
75-
CYPRESS_PREPACKAGED_SITE_URL: "jar:mvn:org.jahia.samples/javascript-modules-samples-hydrogen-prepackaged/LATEST/zip!/site.zip"
19+
uses: Jahia/jahia-modules-action/.github/workflows/reusable-integration-tests.yml@v2
20+
secrets: inherit
21+
with:
22+
jahia_image: ${{ github.event.inputs.jahia_image }}
23+
module_id: javascript-modules-engine
24+
testrail_project: Javascript Modules Engine
25+
pagerduty_skip_notification: true
26+
provisioning_manifest: ${{ github.event.inputs.manifest }}
27+
artifact_prefix: js-eng

.github/workflows/nightly.yml

Lines changed: 15 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,68 +7,21 @@ on:
77

88
jobs:
99
integration-tests-standalone:
10-
name: Integration Tests (Standalone)
11-
runs-on: self-hosted
10+
uses: Jahia/jahia-modules-action/.github/workflows/reusable-integration-tests.yml@v2
11+
secrets: inherit
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
# For the time being testing on the release has been desactived since there is no release yet
16-
# jahia_image: ["jahia/jahia-ee-dev:8", "ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT"]
17-
jahia_image: ["ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT"]
18-
timeout-minutes: 45
19-
steps:
20-
- uses: jahia/jahia-modules-action/helper@v2
21-
- uses: KengoTODA/actions-setup-docker-compose@main
22-
with:
23-
version: "1.29.2"
24-
- uses: actions/setup-node@v4
25-
with:
26-
node-version: "lts/*"
27-
- uses: actions/checkout@v4
28-
- uses: jahia/jahia-modules-action/integration-tests@v2
29-
with:
30-
module_id: javascript-modules-engine
31-
tests_path: "javascript-modules-engine/tests/"
32-
testrail_project: Javascript Modules Engine
33-
tests_manifest: provisioning-manifest-snapshot.yml
34-
jahia_image: ${{ matrix.jahia_image }}
35-
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
36-
should_use_build_artifacts: false
37-
should_skip_testrail: false
38-
github_artifact_name: js-eng-${{ strategy.job-index }}-${{ github.run_number }}
39-
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
40-
docker_registries: |
41-
[
42-
{
43-
"registry": "ghcr.io",
44-
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
45-
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
46-
},
47-
{
48-
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
49-
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
50-
}
51-
]
52-
nexus_username: ${{ secrets.NEXUS_USERNAME }}
53-
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
54-
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
55-
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
56-
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
57-
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
58-
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
59-
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
60-
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
61-
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
62-
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
63-
- name: Test Report
64-
uses: dorny/test-reporter@v1
65-
if: success() || failure()
66-
with:
67-
name: Tests Report (Standalone)
68-
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
69-
reporter: java-junit
70-
fail-on-error: "false"
71-
env:
72-
# During nightly tests, the prepackaged site is fetched from a Maven repository.
73-
# For test executions using built artifacts, a local prepackaged archive is used (moved to the ./artifacts/ folder during the build).
74-
CYPRESS_PREPACKAGED_SITE_URL: "jar:mvn:org.jahia.samples/javascript-modules-samples-hydrogen-prepackaged/LATEST/zip!/site.zip"
15+
include:
16+
- jahia_image: jahia/jahia-ee:8
17+
incident_service_suffix: RL
18+
- jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
19+
incident_service_suffix: SN
20+
with:
21+
jahia_image: ${matrix.jahia_image}
22+
module_id: javascript-modules-engine
23+
testrail_project: Javascript Modules Engine
24+
pagerduty_incident_service: javascript-modules-engine-{{ matrix.incident_service_suffix }}
25+
provisioning_manifest: provisioning-manifest-snapshot.yml
26+
artifact_prefix: js-eng
27+
module_branch: ${{ github.ref }}

.github/workflows/on-code-change.yml

Lines changed: 16 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -13,120 +13,22 @@ on:
1313
- "docs/**"
1414

1515
jobs:
16-
static-analysis:
17-
name: Static Analysis (linting, vulns)
18-
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/checkout@v4
21-
- uses: jahia/jahia-modules-action/static-analysis@v2
22-
with:
23-
node_version: 20
24-
yarn_version: 4.7.0
25-
yarn_test_version: 4.7.0
26-
auditci_level: critical
27-
28-
build:
29-
name: Build Module
30-
runs-on: self-hosted
31-
env:
32-
NEXUS_INTERNAL_URL: ${{ secrets.NEXUS_INTERNAL_URL }}
33-
container:
34-
image: ghcr.io/jahia/jahia-docker-mvn-cache:17-jdk-noble-mvn-loaded
35-
credentials:
36-
username: ${{ secrets.GH_PACKAGES_USERNAME }}
37-
password: ${{ secrets.GH_PACKAGES_TOKEN }}
38-
steps:
39-
- uses: actions/checkout@v4
40-
- uses: jahia/jahia-modules-action/build@v2
41-
with:
42-
# the test module is built as part of the Maven build
43-
tests_module_type: "disabled"
44-
mvn_settings_filepath: ".github/maven.settings.xml"
45-
nexus_username: ${{ secrets.NEXUS_USERNAME }}
46-
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
47-
48-
sonar-analysis:
49-
name: Sonar Analysis
50-
needs: build
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@v4
54-
- uses: jahia/jahia-modules-action/sonar-analysis@v2
55-
with:
56-
primary_release_branch: main
57-
github_pr_id: ${{github.event.number}}
58-
sonar_url: ${{ secrets.SONAR_URL }}
59-
sonar_token: ${{ secrets.SONAR_TOKEN }}
60-
mvn_settings_filepath: ".github/maven.settings.xml"
61-
nexus_username: ${{ secrets.NEXUS_USERNAME }}
62-
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
63-
64-
integration-tests-standalone:
65-
name: Integration Tests (Standalone)
66-
needs: build
67-
runs-on: self-hosted
68-
strategy:
69-
fail-fast: false
70-
timeout-minutes: 45
71-
steps:
72-
- uses: jahia/jahia-modules-action/helper@v2
73-
- uses: KengoTODA/actions-setup-docker-compose@main
74-
with:
75-
version: "1.29.2"
76-
- uses: actions/setup-node@v4
77-
with:
78-
node-version: "lts/*"
79-
# Enable corepack, the Node-provided package manager manager
80-
- run: corepack enable
81-
- uses: actions/checkout@v4
82-
- uses: jahia/jahia-modules-action/integration-tests@v2
83-
with:
84-
module_id: javascript-modules-engine
85-
tests_path: "javascript-modules-engine/tests/"
86-
testrail_project: Javascript Modules Engine
87-
tests_manifest: provisioning-manifest-build.yml
88-
jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
89-
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
90-
should_use_build_artifacts: true
91-
github_artifact_name: js-eng-${{ github.run_number }}
92-
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
93-
docker_registries: |
94-
[
95-
{
96-
"registry": "ghcr.io",
97-
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
98-
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
99-
},
100-
{
101-
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
102-
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
103-
}
104-
]
105-
nexus_username: ${{ secrets.NEXUS_USERNAME }}
106-
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
107-
tests_report_name: Test report (Standalone)
108-
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
109-
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
110-
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
111-
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
112-
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
113-
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
114-
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
115-
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
116-
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
117-
env:
118-
YARN_VERSION: 4.7.0
119-
# glob filename, related to the ./artifacts/ folder, to use to fetch the prepackaged site. This jar is generated by the 'build' step.
120-
# for nightly/manual tests, the prepackaged site is fetched from a Maven repository.
121-
CYPRESS_PREPACKAGED_SITE_URL: "javascript-modules-samples-hydrogen-prepackaged-*.jar"
122-
- name: Test Report
123-
uses: dorny/test-reporter@v1
124-
if: success() || failure()
125-
with:
126-
name: Tests Report (Standalone)
127-
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
128-
reporter: java-junit
129-
fail-on-error: "false"
16+
on-code-change:
17+
uses: Jahia/jahia-modules-action/.github/workflows/reusable-on-code-change.yml@v2
18+
secrets: inherit
19+
with:
20+
static_analysis_node_version: 20
21+
static_analysis_auditci_level: critical
22+
build_container_image: ghcr.io/jahia/jahia-docker-mvn-cache:17-jdk-noble-mvn-loaded
23+
module_branch: ${{ github.ref }}
24+
sonar_analysis_primary_release_branch: main
25+
integration_tests_standalone_execute: true
26+
module_id: javascript-modules-engine
27+
integration_tests_testrail_project: Javascript Modules Engine
28+
integration_tests_jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
29+
integration_tests_provisioning_manifest: provisioning-manifest-build.yml
30+
integration_tests_should_use_build_artifacts: true
31+
integration_tests_should_skip_testrail: true
13032

13133
# This workflow ensures that Windows builds are exactly the same as on other platforms
13234
test-on-windows:

.github/workflows/on-merge.yml

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -62,67 +62,15 @@ jobs:
6262
sbom_artifacts: "build-artifacts"
6363

6464
integration-tests-standalone:
65-
name: Integration Tests (Standalone)
65+
uses: Jahia/jahia-modules-action/.github/workflows/reusable-integration-tests.yml@v2
6666
needs: build
67-
runs-on: self-hosted
68-
timeout-minutes: 45
69-
steps:
70-
- uses: jahia/jahia-modules-action/helper@v2
71-
- uses: KengoTODA/actions-setup-docker-compose@main
72-
with:
73-
version: "1.29.2"
74-
- uses: actions/setup-node@v4
75-
with:
76-
node-version: "lts/*"
77-
- uses: actions/checkout@v4
78-
- uses: jahia/jahia-modules-action/integration-tests@v2
79-
with:
80-
module_id: javascript-modules-engine
81-
tests_path: "javascript-modules-engine/tests/"
82-
testrail_project: Javascript Modules Engine
83-
tests_manifest: provisioning-manifest-build.yml
84-
jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
85-
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
86-
should_use_build_artifacts: true
87-
should_skip_testrail: false
88-
github_artifact_name: js-eng-${{ github.run_number }}
89-
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
90-
docker_registries: |
91-
[
92-
{
93-
"registry": "ghcr.io",
94-
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
95-
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
96-
},
97-
{
98-
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
99-
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
100-
}
101-
]
102-
nexus_username: ${{ secrets.NEXUS_USERNAME }}
103-
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
104-
tests_report_name: Test report (Standalone)
105-
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
106-
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
107-
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
108-
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
109-
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
110-
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
111-
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
112-
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
113-
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
114-
- name: Test Report
115-
uses: dorny/test-reporter@v1
116-
if: success() || failure()
117-
with:
118-
name: Tests Report (Standalone)
119-
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
120-
reporter: java-junit
121-
fail-on-error: "false"
122-
env:
123-
# glob filename, related to the ./artifacts/ folder, to use to fetch the prepackaged site. This jar is generated by the 'build' step.
124-
# for nightly/manual tests, the prepackaged site is fetched from a Maven repository.
125-
CYPRESS_PREPACKAGED_SITE_URL: "javascript-modules-samples-hydrogen-prepackaged-*.jar"
67+
secrets: inherit
68+
with:
69+
jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
70+
module_id: javascript-modules-engine
71+
testrail_project: Javascript Modules Engine
72+
provisioning_manifest: provisioning-manifest-build.yml
73+
artifact_prefix: js-eng
12674

12775
publish:
12876
name: Publish module

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ node_modules/
1616
**/.yarn/cache/
1717
javascript-modules-engine/src/main/resources/javascript/
1818
javascript-modules-engine/src/main/resources/META-INF/js/
19-
javascript-modules-engine/tests/artifacts/
20-
javascript-modules-engine/tests/results/
19+
tests/artifacts/
20+
tests/results/

javascript-modules-engine/tests/.dockerignore renamed to tests/.dockerignore

File renamed without changes.

javascript-modules-engine/tests/.env.example renamed to tests/.env.example

File renamed without changes.

javascript-modules-engine/tests/.yarn/releases/yarn-4.10.3.cjs renamed to tests/.yarn/releases/yarn-4.10.3.cjs

File renamed without changes.

javascript-modules-engine/tests/.yarnrc.yml renamed to tests/.yarnrc.yml

File renamed without changes.

javascript-modules-engine/tests/assets/provisioning.yml renamed to tests/assets/provisioning.yml

File renamed without changes.

0 commit comments

Comments
 (0)