Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 10 additions & 57 deletions .github/workflows/manual-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,13 @@ on:

jobs:
integration-tests:
name: Integration Tests
runs-on: self-hosted
steps:
- uses: jahia/jahia-modules-action/helper@v2
- uses: actions/checkout@v4
- uses: KengoTODA/actions-setup-docker-compose@main
with:
version: "1.29.2"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- uses: jahia/jahia-modules-action/integration-tests@v2
with:
module_id: javascript-modules-engine
tests_path: "javascript-modules-engine/tests/"
testrail_project: Javascript Modules Engine
tests_manifest: ${{ github.event.inputs.manifest }}
jahia_image: ${{ github.event.inputs.jahia_image }}
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
should_use_build_artifacts: false
github_artifact_name: js-eng-${{ github.run_number }}
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
docker_registries: |
[
{
"registry": "ghcr.io",
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
},
{
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
}
]
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests Report (Standalone)
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: "false"
env:
# During manual tests, the prepackaged site is fetched from a Maven repository.
# For test executions using built artifacts, a local prepackaged archive is used (moved to the ./artifacts/ folder during the build).
CYPRESS_PREPACKAGED_SITE_URL: "jar:mvn:org.jahia.samples/javascript-modules-samples-hydrogen-prepackaged/LATEST/zip!/site.zip"
uses: Jahia/jahia-modules-action/.github/workflows/reusable-integration-tests.yml@v2
secrets: inherit
with:
jahia_image: ${{ github.event.inputs.jahia_image }}
module_id: javascript-modules-engine
testrail_project: Javascript Modules Engine
module_branch: ${{ github.ref }}
pagerduty_skip_notification: true
provisioning_manifest: ${{ github.event.inputs.manifest }}
artifact_prefix: js-eng
75 changes: 13 additions & 62 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,19 @@ on:

jobs:
integration-tests-standalone:
name: Integration Tests (Standalone)
runs-on: self-hosted
uses: Jahia/jahia-modules-action/.github/workflows/reusable-integration-tests.yml@v2
secrets: inherit
strategy:
fail-fast: false
matrix:
# For the time being testing on the release has been desactived since there is no release yet
# jahia_image: ["jahia/jahia-ee-dev:8", "ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT"]
jahia_image: ["ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT"]
timeout-minutes: 45
steps:
- uses: jahia/jahia-modules-action/helper@v2
- uses: KengoTODA/actions-setup-docker-compose@main
with:
version: "1.29.2"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- uses: actions/checkout@v4
- uses: jahia/jahia-modules-action/integration-tests@v2
with:
module_id: javascript-modules-engine
tests_path: "javascript-modules-engine/tests/"
testrail_project: Javascript Modules Engine
tests_manifest: provisioning-manifest-snapshot.yml
jahia_image: ${{ matrix.jahia_image }}
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
should_use_build_artifacts: false
should_skip_testrail: false
github_artifact_name: js-eng-${{ strategy.job-index }}-${{ github.run_number }}
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
docker_registries: |
[
{
"registry": "ghcr.io",
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
},
{
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
}
]
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests Report (Standalone)
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: "false"
env:
# During nightly tests, the prepackaged site is fetched from a Maven repository.
# For test executions using built artifacts, a local prepackaged archive is used (moved to the ./artifacts/ folder during the build).
CYPRESS_PREPACKAGED_SITE_URL: "jar:mvn:org.jahia.samples/javascript-modules-samples-hydrogen-prepackaged/LATEST/zip!/site.zip"
include:
- jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
suffix: SN
with:
jahia_image: ${{ matrix.jahia_image }}
module_id: javascript-modules-engine
testrail_project: Javascript Modules Engine
pagerduty_incident_service: javascript-modules-engine-${{ matrix.suffix }}
provisioning_manifest: provisioning-manifest-snapshot.yml
artifact_prefix: tests-${{ matrix.suffix }}
module_branch: ${{ github.ref }}
130 changes: 16 additions & 114 deletions .github/workflows/on-code-change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,120 +13,22 @@ on:
- "docs/**"

jobs:
static-analysis:
name: Static Analysis (linting, vulns)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jahia/jahia-modules-action/static-analysis@v2
with:
node_version: 20
yarn_version: 4.7.0
yarn_test_version: 4.7.0
auditci_level: critical

build:
name: Build Module
runs-on: self-hosted
env:
NEXUS_INTERNAL_URL: ${{ secrets.NEXUS_INTERNAL_URL }}
container:
image: ghcr.io/jahia/jahia-docker-mvn-cache:17-jdk-noble-mvn-loaded
credentials:
username: ${{ secrets.GH_PACKAGES_USERNAME }}
password: ${{ secrets.GH_PACKAGES_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: jahia/jahia-modules-action/build@v2
with:
# the test module is built as part of the Maven build
tests_module_type: "disabled"
mvn_settings_filepath: ".github/maven.settings.xml"
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

sonar-analysis:
name: Sonar Analysis
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jahia/jahia-modules-action/sonar-analysis@v2
with:
primary_release_branch: main
github_pr_id: ${{github.event.number}}
sonar_url: ${{ secrets.SONAR_URL }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
mvn_settings_filepath: ".github/maven.settings.xml"
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

integration-tests-standalone:
name: Integration Tests (Standalone)
needs: build
runs-on: self-hosted
strategy:
fail-fast: false
timeout-minutes: 45
steps:
- uses: jahia/jahia-modules-action/helper@v2
- uses: KengoTODA/actions-setup-docker-compose@main
with:
version: "1.29.2"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
# Enable corepack, the Node-provided package manager manager
- run: corepack enable
- uses: actions/checkout@v4
- uses: jahia/jahia-modules-action/integration-tests@v2
with:
module_id: javascript-modules-engine
tests_path: "javascript-modules-engine/tests/"
testrail_project: Javascript Modules Engine
tests_manifest: provisioning-manifest-build.yml
jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
should_use_build_artifacts: true
github_artifact_name: js-eng-${{ github.run_number }}
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
docker_registries: |
[
{
"registry": "ghcr.io",
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
},
{
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
}
]
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
tests_report_name: Test report (Standalone)
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
env:
YARN_VERSION: 4.7.0
# glob filename, related to the ./artifacts/ folder, to use to fetch the prepackaged site. This jar is generated by the 'build' step.
# for nightly/manual tests, the prepackaged site is fetched from a Maven repository.
CYPRESS_PREPACKAGED_SITE_URL: "javascript-modules-samples-hydrogen-prepackaged-*.jar"
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests Report (Standalone)
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: "false"
on-code-change:
uses: Jahia/jahia-modules-action/.github/workflows/reusable-on-code-change.yml@v2
secrets: inherit
with:
static_analysis_node_version: 20
static_analysis_auditci_level: critical
build_container_image: ghcr.io/jahia/jahia-docker-mvn-cache:17-jdk-noble-mvn-loaded
module_branch: ${{ github.ref }}
sonar_analysis_primary_release_branch: main
integration_tests_standalone_execute: true
module_id: javascript-modules-engine
integration_tests_testrail_project: Javascript Modules Engine
integration_tests_jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
integration_tests_provisioning_manifest: provisioning-manifest-build.yml
integration_tests_should_use_build_artifacts: true
integration_tests_should_skip_testrail: true

# This workflow ensures that Windows builds are exactly the same as on other platforms
test-on-windows:
Expand Down
68 changes: 8 additions & 60 deletions .github/workflows/on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,67 +62,15 @@ jobs:
sbom_artifacts: "build-artifacts"

integration-tests-standalone:
name: Integration Tests (Standalone)
uses: Jahia/jahia-modules-action/.github/workflows/reusable-integration-tests.yml@v2
needs: build
runs-on: self-hosted
timeout-minutes: 45
steps:
- uses: jahia/jahia-modules-action/helper@v2
- uses: KengoTODA/actions-setup-docker-compose@main
with:
version: "1.29.2"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- uses: actions/checkout@v4
- uses: jahia/jahia-modules-action/integration-tests@v2
with:
module_id: javascript-modules-engine
tests_path: "javascript-modules-engine/tests/"
testrail_project: Javascript Modules Engine
tests_manifest: provisioning-manifest-build.yml
jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }}
should_use_build_artifacts: true
should_skip_testrail: false
github_artifact_name: js-eng-${{ github.run_number }}
bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }}
docker_registries: |
[
{
"registry": "ghcr.io",
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
"password": "${{ secrets.GH_PACKAGES_TOKEN }}"
},
{
"username": "${{ secrets.DOCKERHUB_USERNAME }}",
"password": "${{ secrets.DOCKERHUB_PASSWORD }}"
}
]
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
tests_report_name: Test report (Standalone)
testrail_username: ${{ secrets.TESTRAIL_USERNAME }}
testrail_password: ${{ secrets.TESTRAIL_PASSWORD }}
incident_pagerduty_api_key: ${{ secrets.INCIDENT_PAGERDUTY_API_KEY }}
incident_pagerduty_reporter_email: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_EMAIL }}
incident_pagerduty_reporter_id: ${{ secrets.INCIDENT_PAGERDUTY_REPORTER_ID }}
incident_google_spreadsheet_id: ${{ secrets.INCIDENT_GOOGLE_SPREADSHEET_ID }}
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests Report (Standalone)
path: javascript-modules-engine/tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: "false"
env:
# glob filename, related to the ./artifacts/ folder, to use to fetch the prepackaged site. This jar is generated by the 'build' step.
# for nightly/manual tests, the prepackaged site is fetched from a Maven repository.
CYPRESS_PREPACKAGED_SITE_URL: "javascript-modules-samples-hydrogen-prepackaged-*.jar"
secrets: inherit
with:
jahia_image: ghcr.io/jahia/jahia-ee-dev:8-SNAPSHOT
module_id: javascript-modules-engine
testrail_project: Javascript Modules Engine
provisioning_manifest: provisioning-manifest-build.yml
artifact_prefix: js-eng

publish:
name: Publish module
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ node_modules/
**/.yarn/cache/
javascript-modules-engine/src/main/resources/javascript/
javascript-modules-engine/src/main/resources/META-INF/js/
javascript-modules-engine/tests/artifacts/
javascript-modules-engine/tests/results/
tests/artifacts/
tests/run-artifacts/
tests/results/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"e2e:ci": "cypress run --browser chrome",
"e2e:debug": "cypress open",
"instrument": "nyc instrument --compact=false cypress instrumented",
"lint": "echo 'linting is available at the monorepo root'",
"publish-tests": "yarn version --prerelease --preid=tests && git push --follow-tags && npm publish --access public",
"report:html": "marge --inline results/reports/report.json --reportDir results/reports/",
"report:merge": "mochawesome-merge results/reports/mochawesome*.json > results/reports/report.json && rm results/reports/mochawesome*.json"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading