diff --git a/.github/scripts/daily-report.js b/.github/scripts/daily-report.js index 0bbf29dc..860bf0f1 100644 --- a/.github/scripts/daily-report.js +++ b/.github/scripts/daily-report.js @@ -101,9 +101,8 @@ function generateDailyMarkdownReport( results ) { report += `- **Core Matrix**: Hello Theme × Elementor (main, latest, previous minors)\n`; report += `- **Plus Matrix**: Hello Theme × Hello Plus (latest, previous patch - WordPress.org only)\n`; report += `- **Version Types**: \n`; - report += ` - \`main\` = Latest development version from GitHub\n`; - report += ` - \`X.Y.Z (GA)\` = General availability release version\n`; - report += ` - \`latest-stable\` = Latest published version from WordPress.org\n\n`; + report += ` - \`main\` (Elementor) = GitHub \`main\` branch artifact → \`Elementor main (Github)\`\n`; + report += ` - \`X.Y.Z\` / \`latest-stable\` (Elementor) = WordPress.org GA → \`Elementor X.Y.Z (WordPress)\`\n\n`; report += `## 🔄 Reliability Features\n\n`; report += `- **WordPress Environment**: Automatic retry logic (5 attempts, 30s intervals)\n`; @@ -114,6 +113,42 @@ function generateDailyMarkdownReport( results ) { return report; } +function formatElementorReportLabel( elementorVersion ) { + if ( 'main' === elementorVersion ) { + return 'Elementor main (Github)'; + } + + if ( 'latest-stable' === elementorVersion ) { + return 'Elementor latest-stable (WordPress)'; + } + + if ( /^\d+\.\d+\.\d+$/.test( elementorVersion || '' ) ) { + return `Elementor ${ elementorVersion } (WordPress)`; + } + + return `Elementor ${ elementorVersion }`; +} + +function formatTestDisplayName( test ) { + const baseName = test.name || test.combination || ''; + const elementorVersion = test.elementor_version || ''; + + if ( ! elementorVersion || ! test.combination?.includes( 'el' ) ) { + return baseName; + } + + const elementorLabel = formatElementorReportLabel( elementorVersion ); + + return baseName + .replace( /\s*\+\s*Elementor main\b/i, ` + ${ elementorLabel }` ) + .replace( /\s*\+\s*Elementor [\d.]+\s*\(GA\)/i, ( match ) => { + const versionMatch = match.match( /Elementor ([\d.]+)/ ); + return versionMatch + ? ` + Elementor ${ versionMatch[ 1 ] } (WordPress)` + : ` + ${ elementorLabel }`; + } ); +} + /** * Generates a test results table * @param {Array} tests - Array of test results @@ -128,8 +163,9 @@ function generateTestTable( tests ) { const statusText = getStatusText( test.status, test.conclusion ); const duration = test.duration ? `${ test.duration }m` : '-'; const link = generateResultLink( test ); + const displayName = formatTestDisplayName( test ); - table += `| ${ emoji } ${ statusText } | ${ test.name || test.combination } | ${ duration } | ${ link } |\n`; + table += `| ${ emoji } ${ statusText } | ${ displayName } | ${ duration } | ${ link } |\n`; } ); return table; @@ -184,4 +220,6 @@ module.exports = { generateDailyTriggerReport, generateDailyMarkdownReport, sortDailyResults, + formatElementorReportLabel, + formatTestDisplayName, }; diff --git a/.github/scripts/download-elementor-core.sh b/.github/scripts/download-elementor-core.sh new file mode 100755 index 00000000..eff15410 --- /dev/null +++ b/.github/scripts/download-elementor-core.sh @@ -0,0 +1,139 @@ +#!/usr/bin/env bash +set -euo pipefail + +ELEMENTOR_CORE_BRANCH="${1:?Elementor core branch or version required}" +TARGET_DIR="${2:-./tmp/elementor}" + +log_cloud_devops_token_status() { + echo "=== CLOUD_DEVOPS_TOKEN verification ===" + if [ -z "${GITHUB_TOKEN:-}" ]; then + echo "CLOUD_DEVOPS_TOKEN: NOT AVAILABLE (GITHUB_TOKEN env is empty or unset)" + echo "install-source=none" >> "${GITHUB_OUTPUT}" + return 1 + fi + + echo "CLOUD_DEVOPS_TOKEN: available (character length=${#GITHUB_TOKEN})" + + local repo_http_status + repo_http_status=$(curl -sS -o /dev/null -w "%{http_code}" \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/elementor/elementor") + + echo "GitHub API repos/elementor/elementor: HTTP ${repo_http_status}" + + if [ "${repo_http_status}" != "200" ]; then + echo "CLOUD_DEVOPS_TOKEN: cannot read elementor/elementor (expected HTTP 200)" + return 1 + fi + + echo "CLOUD_DEVOPS_TOKEN: repository access OK" + return 0 +} + +write_outputs() { + local effective_version="$1" + local install_source="$2" + echo "effective-version=${effective_version}" >> "${GITHUB_OUTPUT}" + echo "install-source=${install_source}" >> "${GITHUB_OUTPUT}" +} + +download_from_wordpress_org() { + local version_label="$1" + local download_url="$2" + + echo "Downloading Elementor from WordPress.org: ${version_label}" + curl --location -o ./elementor-core.zip "${download_url}" + unzip -q ./elementor-core.zip + rm -rf "${TARGET_DIR}" + mkdir -p "$(dirname "${TARGET_DIR}")" + mv ./elementor "${TARGET_DIR}" + rm -f ./elementor-core.zip + echo "Elementor ${version_label} downloaded from WordPress.org" + write_outputs "${version_label}" "wordpress" +} + +download_from_github_artifact() { + local branch="$1" + + echo "Downloading Elementor from GitHub Actions artifact (branch: ${branch})" + + if ! log_cloud_devops_token_status; then + echo "Missing or invalid CLOUD_DEVOPS_TOKEN; cannot download GitHub artifacts" + exit 1 + fi + + local api_url runs_json run_id arts_json first_artifact artifact_name artifact_url + + api_url="https://api.github.com/repos/elementor/elementor/actions/workflows/build.yml/runs?branch=${branch}&status=success&event=push&per_page=1" + runs_json=$(curl -sS -H "Authorization: Bearer ${GITHUB_TOKEN}" -H "Accept: application/vnd.github+json" "${api_url}") + + local runs_http_status + runs_http_status=$(curl -sS -o /dev/null -w "%{http_code}" \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "${api_url}") + echo "GitHub API workflow runs for branch ${branch}: HTTP ${runs_http_status}" + + run_id=$(echo "${runs_json}" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{const d=JSON.parse(s);const r=(d.workflow_runs||[])[0];if(!r){process.exit(2)}console.log(r.id)})") || { + echo "No successful build found for branch ${branch}" + exit 1 + } + + echo "Latest successful build run id: ${run_id}" + + arts_json=$(curl -sS -H "Authorization: Bearer ${GITHUB_TOKEN}" -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/elementor/elementor/actions/runs/${run_id}/artifacts") + + first_artifact=$(echo "${arts_json}" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{const d=JSON.parse(s);const a=(d.artifacts||[])[0];if(!a){process.exit(1)}console.log(a.name+'\t'+a.archive_download_url)})") + + if [ -z "${first_artifact}" ]; then + echo "No artifacts found for run ${run_id}" + exit 1 + fi + + artifact_name=$(echo "${first_artifact}" | cut -f1) + artifact_url=$(echo "${first_artifact}" | cut -f2) + echo "Downloading artifact: ${artifact_name}" + + mkdir -p ./elementor-artifact + curl -sSL -H "Authorization: Bearer ${GITHUB_TOKEN}" -H "Accept: application/vnd.github+json" \ + -o "./elementor-artifact/${artifact_name}.zip" "${artifact_url}" + + rm -rf "${TARGET_DIR}" + mkdir -p "${TARGET_DIR}" + unzip -q "./elementor-artifact/${artifact_name}.zip" -d "${TARGET_DIR}" + + if [ -f "${TARGET_DIR}/elementor.php" ]; then + echo "GitHub artifact extracted successfully to ${TARGET_DIR}" + write_outputs "${branch}" "github" + return 0 + fi + + echo "Invalid GitHub artifact: elementor.php not found in ${TARGET_DIR}" + ls -la "${TARGET_DIR}/" | head -10 || true + exit 1 +} + +rm -rf "${TARGET_DIR}" ./elementor ./elementor-core.zip ./elementor-artifact 2>/dev/null || true +mkdir -p "$(dirname "${TARGET_DIR}")" + +echo "Elementor download requested: ${ELEMENTOR_CORE_BRANCH}" + +if [[ "${ELEMENTOR_CORE_BRANCH}" == "latest-stable" ]]; then + download_from_wordpress_org "latest-stable" "https://downloads.wordpress.org/plugin/elementor.latest-stable.zip" +elif [[ "${ELEMENTOR_CORE_BRANCH}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + download_url="https://downloads.wordpress.org/plugin/elementor.${ELEMENTOR_CORE_BRANCH}.zip" + http_status=$(curl --silent --head --location --write-out "%{http_code}" --output /dev/null "${download_url}") + + if [[ "${http_status}" == "200" ]]; then + download_from_wordpress_org "${ELEMENTOR_CORE_BRANCH}" "${download_url}" + else + echo "Elementor version ${ELEMENTOR_CORE_BRANCH} not found on WordPress.org (HTTP ${http_status})" + exit 1 + fi +else + download_from_github_artifact "${ELEMENTOR_CORE_BRANCH}" +fi + +echo "Elementor install complete: branch=${ELEMENTOR_CORE_BRANCH}, target=${TARGET_DIR}" diff --git a/.github/workflows/playwright-with-specific-elementor-version.yml b/.github/workflows/playwright-with-specific-elementor-version.yml index 670f3ef4..00d004c3 100644 --- a/.github/workflows/playwright-with-specific-elementor-version.yml +++ b/.github/workflows/playwright-with-specific-elementor-version.yml @@ -48,6 +48,7 @@ jobs: hello-theme-version: ${{ steps.set-versions.outputs.hello-theme-version }} elementor-core-branch: ${{ steps.set-versions.outputs.elementor-core-branch }} elementor-version: ${{ steps.download-elementor.outputs.effective-version }} + elementor-install-source: ${{ steps.download-elementor.outputs.install-source }} hello-theme-source: ${{ steps.set-versions.outputs.hello-theme-source }} artifact-name: ${{ steps.set-versions.outputs.artifact-name }} steps: @@ -106,40 +107,35 @@ jobs: PACKAGE_VERSION: ${{ steps.set-versions.outputs.hello-theme-version }} BUILD_SCRIPT_PATH: "npm run build:prod" + - name: Verify CLOUD_DEVOPS_TOKEN + env: + GITHUB_TOKEN: ${{ secrets.CLOUD_DEVOPS_TOKEN || secrets.DEVOPS_TOKEN }} + run: | + echo "=== CLOUD_DEVOPS_TOKEN pre-check (core build job) ===" + if [ -z "${GITHUB_TOKEN:-}" ]; then + echo "CLOUD_DEVOPS_TOKEN: NOT AVAILABLE (secrets.CLOUD_DEVOPS_TOKEN is empty or unset)" + exit 1 + fi + echo "CLOUD_DEVOPS_TOKEN: secret is set (character length=${#GITHUB_TOKEN})" + REPO_HTTP=$(curl -sS -o /dev/null -w "%{http_code}" \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/elementor/elementor") + echo "GitHub API repos/elementor/elementor: HTTP ${REPO_HTTP}" + if [ "${REPO_HTTP}" != "200" ]; then + echo "CLOUD_DEVOPS_TOKEN: failed repository access check (expected HTTP 200)" + exit 1 + fi + echo "CLOUD_DEVOPS_TOKEN: repository access OK" + - name: Download Elementor Core id: download-elementor + env: + GITHUB_TOKEN: ${{ secrets.CLOUD_DEVOPS_TOKEN || secrets.DEVOPS_TOKEN }} run: | - ELEMENTOR_CORE_BRANCH="${{ steps.set-versions.outputs.elementor-core-branch }}" - echo "Downloading Elementor Core branch: ${ELEMENTOR_CORE_BRANCH}" - - # Create Elementor build directory - mkdir -p ./tmp - - if [[ "$ELEMENTOR_CORE_BRANCH" == "latest-stable" ]]; then - # Download latest stable from WordPress.org - curl --location -o ./elementor-core.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-core.zip - mv ./elementor ./tmp/elementor - echo "Elementor latest-stable downloaded and extracted" - echo "effective-version=latest-stable" >> $GITHUB_OUTPUT - elif [[ "$ELEMENTOR_CORE_BRANCH" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - # Download specific version from WordPress.org - curl --location -o ./elementor-core.zip "https://downloads.wordpress.org/plugin/elementor.${ELEMENTOR_CORE_BRANCH}.zip" - unzip -q ./elementor-core.zip - mv ./elementor ./tmp/elementor - echo "Elementor ${ELEMENTOR_CORE_BRANCH} downloaded and extracted" - echo "effective-version=${ELEMENTOR_CORE_BRANCH}" >> $GITHUB_OUTPUT - else - # For branches like 'main', we need GitHub artifacts - # This should be provided by the calling workflow - echo "GitHub artifacts for Elementor branches not implemented yet" - echo "For now, using latest-stable as fallback" - curl --location -o ./elementor-core.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-core.zip - mv ./elementor ./tmp/elementor - echo "Using Elementor latest-stable as fallback for branch: ${ELEMENTOR_CORE_BRANCH}" - echo "effective-version=latest-stable" >> $GITHUB_OUTPUT - fi + bash ./.github/scripts/download-elementor-core.sh \ + "${{ steps.set-versions.outputs.elementor-core-branch }}" \ + "./tmp/elementor" - name: Upload core build artifacts uses: actions/upload-artifact@v4 @@ -157,9 +153,15 @@ jobs: echo "| Component | Version | Source |" >> $GITHUB_STEP_SUMMARY echo "|-----------------|----------------------------|-----------------------|" >> $GITHUB_STEP_SUMMARY echo "| Hello Theme | ${{ env.HELLO_THEME_VERSION }} (${{ env.HELLO_THEME_INPUT }}) | ${{ env.HELLO_THEME_SOURCE_TYPE }} |" >> $GITHUB_STEP_SUMMARY - echo "| Elementor Core | ${{ steps.download-elementor.outputs.effective-version }} | WordPress.org/GitHub |" >> $GITHUB_STEP_SUMMARY + ELEMENTOR_SOURCE="${{ steps.download-elementor.outputs.install-source }}" + if [ "${ELEMENTOR_SOURCE}" = "github" ]; then + ELEMENTOR_SOURCE_LABEL="GitHub artifact" + else + ELEMENTOR_SOURCE_LABEL="WordPress.org" + fi + echo "| Elementor Core | ${{ steps.download-elementor.outputs.effective-version }} | ${ELEMENTOR_SOURCE_LABEL} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Strategy:** GitHub source for Hello Theme (always built), WordPress.org for Elementor versions" >> $GITHUB_STEP_SUMMARY + echo "**Strategy:** GitHub source for Hello Theme; Elementor from WordPress.org (GA) or GitHub artifacts (branches)" >> $GITHUB_STEP_SUMMARY core-playwright-tests: name: Hello Theme + Elementor Tests @@ -285,64 +287,20 @@ jobs: name: ${{ needs.build-core-components.outputs.artifact-name }} path: ./ - - name: Debug and fix artifacts structure + - name: Verify Elementor build artifacts run: | - echo "=== ARTIFACT DEBUG & FIX ===" - echo "Current directory contents:" - ls -la ./ - echo "" - - # Ensure tmp directory exists - mkdir -p ./tmp - - echo "Checking for Elementor artifacts:" - if [ -d "./tmp/elementor" ]; then - echo "Elementor directory found in tmp" - echo "Contents of ./tmp/elementor/ (first 10):" - ls -la ./tmp/elementor/ | head -10 - - # Verify Elementor plugin file - if [ -f "./tmp/elementor/elementor.php" ]; then - echo "Elementor plugin file verified" - else - echo "Missing elementor.php - attempting to fix" - # Try to find and move Elementor from other locations - if [ -d "./elementor" ]; then - echo "Found Elementor in root, moving to tmp" - mv "./elementor" "./tmp/elementor" - else - echo "Downloading Elementor latest-stable as fallback" - curl --location -o ./elementor-fallback.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-fallback.zip - mv ./elementor ./tmp/elementor - echo "Elementor fallback installed" - fi - fi - else - echo "No Elementor directory - creating fallback" - # Check for loose Elementor files and move them - if [ -d "./elementor" ]; then - echo "Found Elementor in root, moving to tmp" - mv "./elementor" "./tmp/elementor" - else - echo "Downloading Elementor latest-stable as fallback" - curl --location -o ./elementor-fallback.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-fallback.zip - mv ./elementor ./tmp/elementor - echo "Elementor fallback installed" - fi + echo "=== Elementor artifact verification ===" + if [ -d "./elementor" ] && [ ! -d "./tmp/elementor" ]; then + mkdir -p ./tmp + mv "./elementor" "./tmp/elementor" + echo "Moved Elementor from workspace root to ./tmp/elementor" fi - - echo "" - echo "Final verification:" - echo "tmp directory contents:" - ls -la ./tmp/ - if [ -f "./tmp/elementor/elementor.php" ]; then - echo "Elementor is ready at ./tmp/elementor/" - else - echo "Elementor setup failed" + if [ ! -f "./tmp/elementor/elementor.php" ]; then + echo "Elementor plugin missing at ./tmp/elementor/elementor.php" + ls -la ./tmp/ 2>/dev/null || true exit 1 fi + echo "Elementor plugin verified at ./tmp/elementor/" - name: Extract Hello Theme build uses: ./.github/actions/extract-hello-theme-zip @@ -542,64 +500,20 @@ jobs: name: ${{ needs.build-core-components.outputs.artifact-name }} path: ./ - - name: Debug and fix artifacts structure + - name: Verify Elementor build artifacts run: | - echo "=== ARTIFACT DEBUG & FIX ===" - echo "Current directory contents:" - ls -la ./ - echo "" - - # Ensure tmp directory exists - mkdir -p ./tmp - - echo "Checking for Elementor artifacts:" - if [ -d "./tmp/elementor" ]; then - echo "Elementor directory found in tmp" - echo "Contents of ./tmp/elementor/ (first 10):" - ls -la ./tmp/elementor/ | head -10 - - # Verify Elementor plugin file - if [ -f "./tmp/elementor/elementor.php" ]; then - echo "Elementor plugin file verified" - else - echo "Missing elementor.php - attempting to fix" - # Try to find and move Elementor from other locations - if [ -d "./elementor" ]; then - echo "Found Elementor in root, moving to tmp" - mv "./elementor" "./tmp/elementor" - else - echo "Downloading Elementor latest-stable as fallback" - curl --location -o ./elementor-fallback.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-fallback.zip - mv ./elementor ./tmp/elementor - echo "Elementor fallback installed" - fi - fi - else - echo "No Elementor directory - creating fallback" - # Check for loose Elementor files and move them - if [ -d "./elementor" ]; then - echo "Found Elementor in root, moving to tmp" - mv "./elementor" "./tmp/elementor" - else - echo "Downloading Elementor latest-stable as fallback" - curl --location -o ./elementor-fallback.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-fallback.zip - mv ./elementor ./tmp/elementor - echo "Elementor fallback installed" - fi + echo "=== Elementor artifact verification ===" + if [ -d "./elementor" ] && [ ! -d "./tmp/elementor" ]; then + mkdir -p ./tmp + mv "./elementor" "./tmp/elementor" + echo "Moved Elementor from workspace root to ./tmp/elementor" fi - - echo "" - echo "Final verification:" - echo "tmp directory contents:" - ls -la ./tmp/ - if [ -f "./tmp/elementor/elementor.php" ]; then - echo "Elementor is ready at ./tmp/elementor/" - else - echo "Elementor setup failed" + if [ ! -f "./tmp/elementor/elementor.php" ]; then + echo "Elementor plugin missing at ./tmp/elementor/elementor.php" + ls -la ./tmp/ 2>/dev/null || true exit 1 fi + echo "Elementor plugin verified at ./tmp/elementor/" - name: Extract Hello Theme build uses: ./.github/actions/extract-hello-theme-zip diff --git a/.github/workflows/playwright-with-specific-hello-plus-version.yml b/.github/workflows/playwright-with-specific-hello-plus-version.yml index 6866b739..6d04190e 100644 --- a/.github/workflows/playwright-with-specific-hello-plus-version.yml +++ b/.github/workflows/playwright-with-specific-hello-plus-version.yml @@ -40,6 +40,9 @@ on: description: "Provide @tag or a keyword" required: false type: string + secrets: + CLOUD_DEVOPS_TOKEN: + required: true concurrency: group: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('plus-{0}-{1}', github.run_id, github.event.inputs.hello_plus_version || github.ref) }} @@ -116,33 +119,35 @@ jobs: exit 1 fi + - name: Verify CLOUD_DEVOPS_TOKEN + env: + GITHUB_TOKEN: ${{ secrets.CLOUD_DEVOPS_TOKEN || secrets.DEVOPS_TOKEN }} + run: | + echo "=== CLOUD_DEVOPS_TOKEN pre-check (plus build job) ===" + if [ -z "${GITHUB_TOKEN:-}" ]; then + echo "CLOUD_DEVOPS_TOKEN: NOT AVAILABLE (secrets.CLOUD_DEVOPS_TOKEN is empty or unset)" + exit 1 + fi + echo "CLOUD_DEVOPS_TOKEN: secret is set (character length=${#GITHUB_TOKEN})" + REPO_HTTP=$(curl -sS -o /dev/null -w "%{http_code}" \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/elementor/elementor") + echo "GitHub API repos/elementor/elementor: HTTP ${REPO_HTTP}" + if [ "${REPO_HTTP}" != "200" ]; then + echo "CLOUD_DEVOPS_TOKEN: failed repository access check (expected HTTP 200)" + exit 1 + fi + echo "CLOUD_DEVOPS_TOKEN: repository access OK" + - name: Download Elementor Core id: download-elementor + env: + GITHUB_TOKEN: ${{ secrets.CLOUD_DEVOPS_TOKEN || secrets.DEVOPS_TOKEN }} run: | - ELEMENTOR_CORE_BRANCH="${{ steps.set-versions.outputs.elementor-core-branch }}" - echo "Downloading Elementor Core: ${ELEMENTOR_CORE_BRANCH}" - - mkdir -p ./tmp - - if [[ "$ELEMENTOR_CORE_BRANCH" == "latest-stable" ]]; then - curl --location -o ./elementor-core.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-core.zip - mv ./elementor ./tmp/elementor - echo "Elementor latest-stable downloaded and extracted" - echo "effective-version=latest-stable" >> $GITHUB_OUTPUT - elif [[ "$ELEMENTOR_CORE_BRANCH" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - curl --location -o ./elementor-core.zip "https://downloads.wordpress.org/plugin/elementor.${ELEMENTOR_CORE_BRANCH}.zip" - unzip -q ./elementor-core.zip - mv ./elementor ./tmp/elementor - echo "Elementor ${ELEMENTOR_CORE_BRANCH} downloaded and extracted" - echo "effective-version=${ELEMENTOR_CORE_BRANCH}" >> $GITHUB_OUTPUT - else - echo "GitHub artifacts for Elementor branches not implemented; using latest-stable" - curl --location -o ./elementor-core.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-core.zip - mv ./elementor ./tmp/elementor - echo "effective-version=latest-stable" >> $GITHUB_OUTPUT - fi + bash ./.github/scripts/download-elementor-core.sh \ + "${{ steps.set-versions.outputs.elementor-core-branch }}" \ + "./tmp/elementor" - name: Upload plus build artifacts uses: actions/upload-artifact@v4 @@ -162,9 +167,15 @@ jobs: echo "|-----------------|----------------------------|-----------------------|" >> $GITHUB_STEP_SUMMARY echo "| Hello Theme | ${{ steps.set-versions.outputs.hello-theme-version }} (${{ steps.set-versions.outputs.hello-theme-input }}) | github (checkout ref) |" >> $GITHUB_STEP_SUMMARY echo "| Hello Plus | ${{ steps.set-versions.outputs.hello-plus-version }} | WordPress.org |" >> $GITHUB_STEP_SUMMARY - echo "| Elementor Core | ${{ steps.download-elementor.outputs.effective-version }} | WordPress.org |" >> $GITHUB_STEP_SUMMARY + ELEMENTOR_SOURCE="${{ steps.download-elementor.outputs.install-source }}" + if [ "${ELEMENTOR_SOURCE}" = "github" ]; then + ELEMENTOR_SOURCE_LABEL="GitHub artifact" + else + ELEMENTOR_SOURCE_LABEL="WordPress.org" + fi + echo "| Elementor Core | ${{ steps.download-elementor.outputs.effective-version }} | ${ELEMENTOR_SOURCE_LABEL} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Strategy:** Same Hello Theme build ref as Core matrix; WordPress.org for Hello Plus and Elementor" >> $GITHUB_STEP_SUMMARY + echo "**Strategy:** Same Hello Theme build ref as Core matrix; Hello Plus from WordPress.org; Elementor from WordPress.org or GitHub artifacts" >> $GITHUB_STEP_SUMMARY plus-playwright-tests: name: Hello Theme + Hello Plus Tests diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 9bb0bff9..3046fc56 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -37,7 +37,7 @@ jobs: - name: Install npm dependencies run: npm ci env: - NODE_AUTH_TOKEN: ${{ secrets.CLOUD_DEVOPS_TOKEN }} + NODE_AUTH_TOKEN:${{ secrets.CLOUD_DEVOPS_TOKEN || secrets.DEVOPS_TOKEN }} - name: Build plugin run: npm run build:prod