From c2e1e0cd5c6156460ea6a7f3a71049c2a792d1d0 Mon Sep 17 00:00:00 2001 From: Jorge Moya Date: Mon, 23 Mar 2026 16:48:13 -0500 Subject: [PATCH 1/3] fix: split regression-tests workflow into two separate flows --- ...tests.yml => regression-tests-preview.yml} | 121 +++--------------- .../workflows/regression-tests-production.yml | 119 +++++++++++++++++ 2 files changed, 139 insertions(+), 101 deletions(-) rename .github/workflows/{regression-tests.yml => regression-tests-preview.yml} (51%) create mode 100644 .github/workflows/regression-tests-production.yml diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests-preview.yml similarity index 51% rename from .github/workflows/regression-tests.yml rename to .github/workflows/regression-tests-preview.yml index ec122b1b91..114c6dc411 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests-preview.yml @@ -1,26 +1,24 @@ -name: Regression Tests +name: Regression Tests (Preview) on: deployment_status: states: ["success"] -env: - VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.deployment_status.target_url }} + group: regression-preview-${{ github.event.deployment.sha }} cancel-in-progress: true +env: + VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} + jobs: detect-provider: name: Detect Deployment Provider + if: github.event.deployment.environment == 'Preview' runs-on: ubuntu-latest outputs: provider: ${{ steps.detect.outputs.provider }} - is-preview: ${{ steps.detect.outputs.is-preview }} production-url: ${{ steps.detect.outputs.production-url }} - is-canary-branch: ${{ steps.detect.outputs.is-canary-branch }} - branch-label: ${{ steps.detect.outputs.branch-label }} steps: - uses: actions/checkout@v4 @@ -28,76 +26,38 @@ jobs: id: detect run: | CREATOR="${{ github.event.deployment_status.creator.login }}" - ENVIRONMENT="${{ github.event.deployment.environment }}" if [[ "$CREATOR" == "vercel[bot]" ]]; then echo "provider=vercel" >> $GITHUB_OUTPUT - if [[ "$ENVIRONMENT" == "Preview" ]]; then - echo "is-preview=true" >> $GITHUB_OUTPUT - echo "is-canary-branch=false" >> $GITHUB_OUTPUT - echo "branch-label=" >> $GITHUB_OUTPUT - PKG_NAME=$(node -p "require('./core/package.json').name") - case "$PKG_NAME" in - "@bigcommerce/catalyst-core") - echo "production-url=https://canary.catalyst-demo.site/" >> $GITHUB_OUTPUT ;; - "@bigcommerce/catalyst-makeswift") - echo "production-url=https://canary.makeswift.catalyst-demo.site" >> $GITHUB_OUTPUT ;; - *) - echo "::warning::No production URL configured for package: $PKG_NAME. Skipping comparison." - echo "production-url=" >> $GITHUB_OUTPUT ;; - esac - else - PKG_NAME=$(node -p "require('./core/package.json').name") - echo "is-preview=false" >> $GITHUB_OUTPUT - case "$PKG_NAME" in - "@bigcommerce/catalyst-core") - echo "is-canary-branch=true" >> $GITHUB_OUTPUT - echo "branch-label=canary" >> $GITHUB_OUTPUT - echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; - "@bigcommerce/catalyst-makeswift") - echo "is-canary-branch=true" >> $GITHUB_OUTPUT - echo "branch-label=integrations/makeswift" >> $GITHUB_OUTPUT - echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; - *) - echo "is-canary-branch=false" >> $GITHUB_OUTPUT - echo "branch-label=" >> $GITHUB_OUTPUT - echo "production-url=" >> $GITHUB_OUTPUT ;; - esac - fi + PKG_NAME=$(node -p "require('./core/package.json').name") + case "$PKG_NAME" in + "@bigcommerce/catalyst-core") + echo "production-url=https://canary.catalyst-demo.site/" >> $GITHUB_OUTPUT ;; + "@bigcommerce/catalyst-makeswift") + echo "production-url=https://canary.makeswift.catalyst-demo.site" >> $GITHUB_OUTPUT ;; + *) + echo "::warning::No production URL configured for package: $PKG_NAME. Skipping comparison." + echo "production-url=" >> $GITHUB_OUTPUT ;; + esac elif [[ "$CREATOR" == "cloudflare-pages[bot]" ]]; then echo "provider=cloudflare" >> $GITHUB_OUTPUT - echo "is-canary-branch=false" >> $GITHUB_OUTPUT - echo "branch-label=" >> $GITHUB_OUTPUT - if [[ "$ENVIRONMENT" == "Preview" ]]; then - echo "is-preview=true" >> $GITHUB_OUTPUT - echo "::warning::Cloudflare production URL not yet configured. Skipping comparison." - echo "production-url=" >> $GITHUB_OUTPUT - else - echo "is-preview=false" >> $GITHUB_OUTPUT - echo "production-url=" >> $GITHUB_OUTPUT - fi + echo "::warning::Cloudflare production URL not yet configured. Skipping comparison." + echo "production-url=" >> $GITHUB_OUTPUT else echo "::warning::Unknown deployment provider: $CREATOR. Skipping audits." echo "provider=unknown" >> $GITHUB_OUTPUT - echo "is-preview=false" >> $GITHUB_OUTPUT - echo "is-canary-branch=false" >> $GITHUB_OUTPUT - echo "branch-label=" >> $GITHUB_OUTPUT echo "production-url=" >> $GITHUB_OUTPUT fi unlighthouse-audit-preview: name: Unlighthouse Audit Preview (${{ needs.detect-provider.outputs.provider }}) - ${{ matrix.device }} needs: [detect-provider] - if: needs.detect-provider.outputs.is-preview == 'true' runs-on: ubuntu-latest strategy: matrix: device: [desktop, mobile] - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.deployment_status.target_url }}-${{ matrix.device }} - cancel-in-progress: true steps: - uses: actions/checkout@v4 @@ -130,14 +90,11 @@ jobs: unlighthouse-audit-production: name: Unlighthouse Audit Production (${{ needs.detect-provider.outputs.provider }}) - ${{ matrix.device }} needs: [detect-provider] - if: (needs.detect-provider.outputs.is-preview == 'true' && needs.detect-provider.outputs.production-url != '') || needs.detect-provider.outputs.is-canary-branch == 'true' + if: needs.detect-provider.outputs.production-url != '' runs-on: ubuntu-latest strategy: matrix: device: [desktop, mobile] - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-production-${{ matrix.device }} - cancel-in-progress: true steps: - uses: actions/checkout@v4 @@ -161,7 +118,7 @@ jobs: unlighthouse-compare: name: Unlighthouse Compare & Comment (${{ needs.detect-provider.outputs.provider }}) needs: [detect-provider, unlighthouse-audit-preview, unlighthouse-audit-production] - if: needs.detect-provider.outputs.is-preview == 'true' && needs.detect-provider.outputs.production-url != '' + if: needs.detect-provider.outputs.production-url != '' runs-on: ubuntu-latest permissions: pull-requests: write @@ -206,41 +163,3 @@ jobs: reportPath: '/tmp/unlighthouse-report.md', metaPath: '/tmp/unlighthouse-meta.json', }) - - unlighthouse-report: - name: Unlighthouse Report (${{ needs.detect-provider.outputs.provider }}) — ${{ needs.detect-provider.outputs.branch-label }} - needs: [detect-provider, unlighthouse-audit-production] - if: needs.detect-provider.outputs.is-canary-branch == 'true' - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - name: Download production Unlighthouse artifacts - uses: actions/download-artifact@v4 - with: - pattern: unlighthouse-production-*-report - path: /tmp/unlighthouse-artifacts - merge-multiple: false - - - name: Format report - run: | - node .github/scripts/audit-unlighthouse.mts \ - --desktop /tmp/unlighthouse-artifacts/unlighthouse-production-desktop-report/ci-result.json \ - --mobile /tmp/unlighthouse-artifacts/unlighthouse-production-mobile-report/ci-result.json \ - --branch "${{ needs.detect-provider.outputs.branch-label }}" \ - --output /tmp/unlighthouse-report.md - cat /tmp/unlighthouse-report.md >> "$GITHUB_STEP_SUMMARY" - - - name: Post commit comment - uses: actions/github-script@v7 - with: - script: | - const postReport = require('./.github/scripts/post-unlighthouse-commit-comment.js') - await postReport({ github, context, reportPath: '/tmp/unlighthouse-report.md' }) diff --git a/.github/workflows/regression-tests-production.yml b/.github/workflows/regression-tests-production.yml new file mode 100644 index 0000000000..1be8a59430 --- /dev/null +++ b/.github/workflows/regression-tests-production.yml @@ -0,0 +1,119 @@ +name: Regression Tests (Production) + +on: + deployment_status: + states: ["success"] + +concurrency: + group: regression-production-${{ github.event.deployment.sha }} + cancel-in-progress: false + +jobs: + detect-provider: + name: Detect Deployment Provider + if: github.event.deployment.environment != 'Preview' + runs-on: ubuntu-latest + outputs: + provider: ${{ steps.detect.outputs.provider }} + production-url: ${{ steps.detect.outputs.production-url }} + branch-label: ${{ steps.detect.outputs.branch-label }} + steps: + - uses: actions/checkout@v4 + + - name: Detect provider and production URL + id: detect + run: | + CREATOR="${{ github.event.deployment_status.creator.login }}" + + if [[ "$CREATOR" == "vercel[bot]" ]]; then + echo "provider=vercel" >> $GITHUB_OUTPUT + PKG_NAME=$(node -p "require('./core/package.json').name") + case "$PKG_NAME" in + "@bigcommerce/catalyst-core") + echo "branch-label=canary" >> $GITHUB_OUTPUT + echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; + "@bigcommerce/catalyst-makeswift") + echo "branch-label=integrations/makeswift" >> $GITHUB_OUTPUT + echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; + *) + echo "branch-label=" >> $GITHUB_OUTPUT + echo "production-url=" >> $GITHUB_OUTPUT ;; + esac + + elif [[ "$CREATOR" == "cloudflare-pages[bot]" ]]; then + echo "provider=cloudflare" >> $GITHUB_OUTPUT + echo "branch-label=" >> $GITHUB_OUTPUT + echo "production-url=" >> $GITHUB_OUTPUT + + else + echo "::warning::Unknown deployment provider: $CREATOR. Skipping audits." + echo "provider=unknown" >> $GITHUB_OUTPUT + echo "branch-label=" >> $GITHUB_OUTPUT + echo "production-url=" >> $GITHUB_OUTPUT + fi + + unlighthouse-audit-production: + name: Unlighthouse Audit Production (${{ needs.detect-provider.outputs.provider }}) - ${{ matrix.device }} + needs: [detect-provider] + if: needs.detect-provider.outputs.production-url != '' + runs-on: ubuntu-latest + strategy: + matrix: + device: [desktop, mobile] + + steps: + - uses: actions/checkout@v4 + + - name: Install Dependencies + run: npm install @unlighthouse/cli puppeteer -g + + - name: Unlighthouse audit on ${{ matrix.device }} (production) + env: + PRODUCTION_URL: ${{ needs.detect-provider.outputs.production-url }} + run: unlighthouse-ci --site "$PRODUCTION_URL" --${{ matrix.device }} --disable-robots-txt + + - name: Upload ${{ matrix.device }} production audit + if: failure() || success() + uses: actions/upload-artifact@v4 + with: + name: unlighthouse-production-${{ matrix.device }}-report + path: "./.unlighthouse/" + include-hidden-files: "true" + + unlighthouse-report: + name: Unlighthouse Report (${{ needs.detect-provider.outputs.provider }}) — ${{ needs.detect-provider.outputs.branch-label }} + needs: [detect-provider, unlighthouse-audit-production] + if: needs.detect-provider.outputs.production-url != '' + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - name: Download production Unlighthouse artifacts + uses: actions/download-artifact@v4 + with: + pattern: unlighthouse-production-*-report + path: /tmp/unlighthouse-artifacts + merge-multiple: false + + - name: Format report + run: | + node .github/scripts/audit-unlighthouse.mts \ + --desktop /tmp/unlighthouse-artifacts/unlighthouse-production-desktop-report/ci-result.json \ + --mobile /tmp/unlighthouse-artifacts/unlighthouse-production-mobile-report/ci-result.json \ + --branch "${{ needs.detect-provider.outputs.branch-label }}" \ + --output /tmp/unlighthouse-report.md + cat /tmp/unlighthouse-report.md >> "$GITHUB_STEP_SUMMARY" + + - name: Post commit comment + uses: actions/github-script@v7 + with: + script: | + const postReport = require('./.github/scripts/post-unlighthouse-commit-comment.js') + await postReport({ github, context, reportPath: '/tmp/unlighthouse-report.md' }) From 9dbdcb329b88b4007be7cd5c7901f6f7568b9a8e Mon Sep 17 00:00:00 2001 From: Jorge Moya Date: Tue, 24 Mar 2026 08:38:07 -0500 Subject: [PATCH 2/3] fix: merge back to a single file --- .../workflows/regression-tests-production.yml | 119 ------------------ ...tests-preview.yml => regression-tests.yml} | 99 ++++++++++++--- 2 files changed, 83 insertions(+), 135 deletions(-) delete mode 100644 .github/workflows/regression-tests-production.yml rename .github/workflows/{regression-tests-preview.yml => regression-tests.yml} (58%) diff --git a/.github/workflows/regression-tests-production.yml b/.github/workflows/regression-tests-production.yml deleted file mode 100644 index 1be8a59430..0000000000 --- a/.github/workflows/regression-tests-production.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Regression Tests (Production) - -on: - deployment_status: - states: ["success"] - -concurrency: - group: regression-production-${{ github.event.deployment.sha }} - cancel-in-progress: false - -jobs: - detect-provider: - name: Detect Deployment Provider - if: github.event.deployment.environment != 'Preview' - runs-on: ubuntu-latest - outputs: - provider: ${{ steps.detect.outputs.provider }} - production-url: ${{ steps.detect.outputs.production-url }} - branch-label: ${{ steps.detect.outputs.branch-label }} - steps: - - uses: actions/checkout@v4 - - - name: Detect provider and production URL - id: detect - run: | - CREATOR="${{ github.event.deployment_status.creator.login }}" - - if [[ "$CREATOR" == "vercel[bot]" ]]; then - echo "provider=vercel" >> $GITHUB_OUTPUT - PKG_NAME=$(node -p "require('./core/package.json').name") - case "$PKG_NAME" in - "@bigcommerce/catalyst-core") - echo "branch-label=canary" >> $GITHUB_OUTPUT - echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; - "@bigcommerce/catalyst-makeswift") - echo "branch-label=integrations/makeswift" >> $GITHUB_OUTPUT - echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; - *) - echo "branch-label=" >> $GITHUB_OUTPUT - echo "production-url=" >> $GITHUB_OUTPUT ;; - esac - - elif [[ "$CREATOR" == "cloudflare-pages[bot]" ]]; then - echo "provider=cloudflare" >> $GITHUB_OUTPUT - echo "branch-label=" >> $GITHUB_OUTPUT - echo "production-url=" >> $GITHUB_OUTPUT - - else - echo "::warning::Unknown deployment provider: $CREATOR. Skipping audits." - echo "provider=unknown" >> $GITHUB_OUTPUT - echo "branch-label=" >> $GITHUB_OUTPUT - echo "production-url=" >> $GITHUB_OUTPUT - fi - - unlighthouse-audit-production: - name: Unlighthouse Audit Production (${{ needs.detect-provider.outputs.provider }}) - ${{ matrix.device }} - needs: [detect-provider] - if: needs.detect-provider.outputs.production-url != '' - runs-on: ubuntu-latest - strategy: - matrix: - device: [desktop, mobile] - - steps: - - uses: actions/checkout@v4 - - - name: Install Dependencies - run: npm install @unlighthouse/cli puppeteer -g - - - name: Unlighthouse audit on ${{ matrix.device }} (production) - env: - PRODUCTION_URL: ${{ needs.detect-provider.outputs.production-url }} - run: unlighthouse-ci --site "$PRODUCTION_URL" --${{ matrix.device }} --disable-robots-txt - - - name: Upload ${{ matrix.device }} production audit - if: failure() || success() - uses: actions/upload-artifact@v4 - with: - name: unlighthouse-production-${{ matrix.device }}-report - path: "./.unlighthouse/" - include-hidden-files: "true" - - unlighthouse-report: - name: Unlighthouse Report (${{ needs.detect-provider.outputs.provider }}) — ${{ needs.detect-provider.outputs.branch-label }} - needs: [detect-provider, unlighthouse-audit-production] - if: needs.detect-provider.outputs.production-url != '' - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - name: Download production Unlighthouse artifacts - uses: actions/download-artifact@v4 - with: - pattern: unlighthouse-production-*-report - path: /tmp/unlighthouse-artifacts - merge-multiple: false - - - name: Format report - run: | - node .github/scripts/audit-unlighthouse.mts \ - --desktop /tmp/unlighthouse-artifacts/unlighthouse-production-desktop-report/ci-result.json \ - --mobile /tmp/unlighthouse-artifacts/unlighthouse-production-mobile-report/ci-result.json \ - --branch "${{ needs.detect-provider.outputs.branch-label }}" \ - --output /tmp/unlighthouse-report.md - cat /tmp/unlighthouse-report.md >> "$GITHUB_STEP_SUMMARY" - - - name: Post commit comment - uses: actions/github-script@v7 - with: - script: | - const postReport = require('./.github/scripts/post-unlighthouse-commit-comment.js') - await postReport({ github, context, reportPath: '/tmp/unlighthouse-report.md' }) diff --git a/.github/workflows/regression-tests-preview.yml b/.github/workflows/regression-tests.yml similarity index 58% rename from .github/workflows/regression-tests-preview.yml rename to .github/workflows/regression-tests.yml index 114c6dc411..10d5739719 100644 --- a/.github/workflows/regression-tests-preview.yml +++ b/.github/workflows/regression-tests.yml @@ -1,24 +1,21 @@ -name: Regression Tests (Preview) +name: Regression Tests on: deployment_status: states: ["success"] -concurrency: - group: regression-preview-${{ github.event.deployment.sha }} - cancel-in-progress: true - env: VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} jobs: detect-provider: name: Detect Deployment Provider - if: github.event.deployment.environment == 'Preview' runs-on: ubuntu-latest outputs: provider: ${{ steps.detect.outputs.provider }} production-url: ${{ steps.detect.outputs.production-url }} + branch-label: ${{ steps.detect.outputs.branch-label }} + is-preview: ${{ steps.detect.outputs.is-preview }} steps: - uses: actions/checkout@v4 @@ -26,35 +23,64 @@ jobs: id: detect run: | CREATOR="${{ github.event.deployment_status.creator.login }}" + ENVIRONMENT="${{ github.event.deployment.environment }}" + + if [[ "$ENVIRONMENT" == "Preview" ]]; then + echo "is-preview=true" >> $GITHUB_OUTPUT + else + echo "is-preview=false" >> $GITHUB_OUTPUT + fi if [[ "$CREATOR" == "vercel[bot]" ]]; then echo "provider=vercel" >> $GITHUB_OUTPUT PKG_NAME=$(node -p "require('./core/package.json').name") - case "$PKG_NAME" in - "@bigcommerce/catalyst-core") - echo "production-url=https://canary.catalyst-demo.site/" >> $GITHUB_OUTPUT ;; - "@bigcommerce/catalyst-makeswift") - echo "production-url=https://canary.makeswift.catalyst-demo.site" >> $GITHUB_OUTPUT ;; - *) - echo "::warning::No production URL configured for package: $PKG_NAME. Skipping comparison." - echo "production-url=" >> $GITHUB_OUTPUT ;; - esac + + if [[ "$ENVIRONMENT" == "Preview" ]]; then + case "$PKG_NAME" in + "@bigcommerce/catalyst-core") + echo "production-url=https://canary.catalyst-demo.site/" >> $GITHUB_OUTPUT ;; + "@bigcommerce/catalyst-makeswift") + echo "production-url=https://canary.makeswift.catalyst-demo.site" >> $GITHUB_OUTPUT ;; + *) + echo "::warning::No production URL configured for package: $PKG_NAME. Skipping comparison." + echo "production-url=" >> $GITHUB_OUTPUT ;; + esac + echo "branch-label=" >> $GITHUB_OUTPUT + else + case "$PKG_NAME" in + "@bigcommerce/catalyst-core") + echo "branch-label=canary" >> $GITHUB_OUTPUT + echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; + "@bigcommerce/catalyst-makeswift") + echo "branch-label=integrations/makeswift" >> $GITHUB_OUTPUT + echo "production-url=${{ github.event.deployment_status.target_url }}" >> $GITHUB_OUTPUT ;; + *) + echo "branch-label=" >> $GITHUB_OUTPUT + echo "production-url=" >> $GITHUB_OUTPUT ;; + esac + fi elif [[ "$CREATOR" == "cloudflare-pages[bot]" ]]; then echo "provider=cloudflare" >> $GITHUB_OUTPUT echo "::warning::Cloudflare production URL not yet configured. Skipping comparison." echo "production-url=" >> $GITHUB_OUTPUT + echo "branch-label=" >> $GITHUB_OUTPUT else echo "::warning::Unknown deployment provider: $CREATOR. Skipping audits." echo "provider=unknown" >> $GITHUB_OUTPUT echo "production-url=" >> $GITHUB_OUTPUT + echo "branch-label=" >> $GITHUB_OUTPUT fi unlighthouse-audit-preview: name: Unlighthouse Audit Preview (${{ needs.detect-provider.outputs.provider }}) - ${{ matrix.device }} needs: [detect-provider] + if: needs.detect-provider.outputs.is-preview == 'true' runs-on: ubuntu-latest + concurrency: + group: regression-preview-${{ github.event.deployment.sha }}-${{ matrix.device }} + cancel-in-progress: true strategy: matrix: device: [desktop, mobile] @@ -92,6 +118,9 @@ jobs: needs: [detect-provider] if: needs.detect-provider.outputs.production-url != '' runs-on: ubuntu-latest + concurrency: + group: regression-production-${{ github.event.deployment.sha }}-${{ matrix.device }} + cancel-in-progress: ${{ github.event.deployment.environment == 'Preview' }} strategy: matrix: device: [desktop, mobile] @@ -118,7 +147,7 @@ jobs: unlighthouse-compare: name: Unlighthouse Compare & Comment (${{ needs.detect-provider.outputs.provider }}) needs: [detect-provider, unlighthouse-audit-preview, unlighthouse-audit-production] - if: needs.detect-provider.outputs.production-url != '' + if: needs.detect-provider.outputs.is-preview == 'true' && needs.detect-provider.outputs.production-url != '' runs-on: ubuntu-latest permissions: pull-requests: write @@ -163,3 +192,41 @@ jobs: reportPath: '/tmp/unlighthouse-report.md', metaPath: '/tmp/unlighthouse-meta.json', }) + + unlighthouse-report: + name: Unlighthouse Report (${{ needs.detect-provider.outputs.provider }}) — ${{ needs.detect-provider.outputs.branch-label }} + needs: [detect-provider, unlighthouse-audit-production] + if: needs.detect-provider.outputs.is-preview == 'false' && needs.detect-provider.outputs.production-url != '' + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - name: Download production Unlighthouse artifacts + uses: actions/download-artifact@v4 + with: + pattern: unlighthouse-production-*-report + path: /tmp/unlighthouse-artifacts + merge-multiple: false + + - name: Format report + run: | + node .github/scripts/audit-unlighthouse.mts \ + --desktop /tmp/unlighthouse-artifacts/unlighthouse-production-desktop-report/ci-result.json \ + --mobile /tmp/unlighthouse-artifacts/unlighthouse-production-mobile-report/ci-result.json \ + --branch "${{ needs.detect-provider.outputs.branch-label }}" \ + --output /tmp/unlighthouse-report.md + cat /tmp/unlighthouse-report.md >> "$GITHUB_STEP_SUMMARY" + + - name: Post commit comment + uses: actions/github-script@v7 + with: + script: | + const postReport = require('./.github/scripts/post-unlighthouse-commit-comment.js') + await postReport({ github, context, reportPath: '/tmp/unlighthouse-report.md' }) From 0cf74292322ff2392e68f608b2765673f484895e Mon Sep 17 00:00:00 2001 From: Jorge Moya Date: Tue, 24 Mar 2026 08:56:15 -0500 Subject: [PATCH 3/3] use deployments.ref for PRs --- .github/workflows/regression-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 10d5739719..dd4338a274 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -79,7 +79,7 @@ jobs: if: needs.detect-provider.outputs.is-preview == 'true' runs-on: ubuntu-latest concurrency: - group: regression-preview-${{ github.event.deployment.sha }}-${{ matrix.device }} + group: regression-preview-${{ github.event.deployment.ref }}-${{ matrix.device }} cancel-in-progress: true strategy: matrix: @@ -119,7 +119,7 @@ jobs: if: needs.detect-provider.outputs.production-url != '' runs-on: ubuntu-latest concurrency: - group: regression-production-${{ github.event.deployment.sha }}-${{ matrix.device }} + group: regression-production-${{ github.event.deployment.environment == 'Preview' && github.event.deployment.ref || github.event.deployment.sha }}-${{ matrix.device }} cancel-in-progress: ${{ github.event.deployment.environment == 'Preview' }} strategy: matrix: