Skip to content
Closed
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
19 changes: 13 additions & 6 deletions .github/actions/install-playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ runs:
path: |
~/.cache/ms-playwright
# Bump the iteration when bumping runner images to use a new cache
key: playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }}
key:
playwright-${{ runner.os }}${{ runner.arch != 'X64' && format('-{0}', runner.arch) || '' }}-iteration-1-${{
steps.playwright-version.outputs.version }}

# We always install all browsers, if uncached
# `npx` runs outside the repo, so it can't pick up a `playwright` that a parallel `pnpm install` is still linking.
Expand Down Expand Up @@ -112,7 +114,8 @@ runs:
- name: Remove obsolete cached WebKit packages
if:
steps.webkit-dependencies.outputs.key != '' && steps.webkit-apt-cache.outputs.cache-hit != 'true' &&
github.event_name == 'push' && github.ref == 'refs/heads/develop'
(github.event_name == 'push' && github.ref == 'refs/heads/develop' || github.head_ref ==
'feat/benchmark-browser-playwright-arm' && inputs.cwd == 'dev-packages/browser-integration-tests')
# Fallback restores can carry obsolete installers into newer cache entries.
run: sudo apt-get -o Dir::Cache::archives=/var/tmp/webkit-apt-cache autoclean
shell: bash
Expand All @@ -122,7 +125,8 @@ runs:
- name: Store cached WebKit system packages
if:
steps.webkit-dependencies.outputs.key != '' && steps.webkit-apt-cache.outputs.cache-hit != 'true' &&
github.event_name == 'push' && github.ref == 'refs/heads/develop'
(github.event_name == 'push' && github.ref == 'refs/heads/develop' || github.head_ref ==
'feat/benchmark-browser-playwright-arm' && inputs.cwd == 'dev-packages/browser-integration-tests')
uses: actions/cache/save@v6.1.0
with:
path: /var/tmp/webkit-apt-cache/*.deb
Expand All @@ -132,10 +136,13 @@ runs:
- name: Store cached playwright binaries
uses: actions/cache/save@v6.1.0
if:
steps.playwright-version.outputs.version != '' && github.event_name == 'push' && github.ref ==
'refs/heads/develop'
steps.playwright-version.outputs.version != '' && steps.playwright-cache.outputs.cache-hit != 'true' &&
(github.event_name == 'push' && github.ref == 'refs/heads/develop' || github.head_ref ==
'feat/benchmark-browser-playwright-arm' && inputs.cwd == 'dev-packages/browser-integration-tests')
with:
path: |
~/.cache/ms-playwright
# Bump the iteration when bumping runner images to use a new cache
key: playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }}
key:
playwright-${{ runner.os }}${{ runner.arch != 'X64' && format('-{0}', runner.arch) || '' }}-iteration-1-${{
steps.playwright-version.outputs.version }}
26 changes: 23 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:
cancel-in-progress: true

env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
HEAD_COMMIT: ${{ github.event.inputs.commit || github.event.pull_request.head.sha || github.sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR CI checks out unmerged head

High Severity

HEAD_COMMIT now prefers github.event.pull_request.head.sha over github.sha, so PR jobs check out the branch tip instead of GitHub's merge commit. job_get_metadata still receives github.sha, and Nx affected compares that head against pull_request.base.sha from a pair of depth-1 checkouts. Those two commits usually do not share fetched ancestry, so git merge-base can fail and take down job_build for multi-commit or out-of-date PRs. Even when it works, CI no longer tests the merged result.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e42696a. Configure here.


CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
Expand Down Expand Up @@ -592,7 +592,7 @@ jobs:
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
runs-on: ubuntu-24.04-arm
timeout-minutes: 25
strategy:
fail-fast: false
Expand Down Expand Up @@ -690,6 +690,16 @@ jobs:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}

- name: Record browser benchmark hardware
working-directory: dev-packages/browser-integration-tests
run: |
node -e '
const os = require("node:os");
const info = { arch: process.arch, cores: os.availableParallelism(), cpu: os.cpus()[0].model, memoryBytes: os.totalmem() };
require("node:fs").writeFileSync("browser-runner.json", JSON.stringify(info));
console.log(info);
'

- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
Expand All @@ -704,6 +714,16 @@ jobs:
pnpm run test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}

- name: Upload browser benchmark results
if: always()
uses: actions/upload-artifact@v7
with:
name: browser-benchmark-${{ matrix.bundle }}-${{ matrix.project }}-${{ matrix.shard || '0' }}
path: |
dev-packages/browser-integration-tests/results.junit.xml
dev-packages/browser-integration-tests/browser-runner.json
if-no-files-found: error

- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
Expand Down Expand Up @@ -954,7 +974,7 @@ jobs:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
ref: ${{ github.sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundler tests checkout mismatches build

Medium Severity

job_bundler_plugin_integration_tests now checks out github.sha while job_build and the rest of the workflow use HEAD_COMMIT (pull_request.head.sha on PRs). This job still restores job_build's node_modules cache and build-output artifacts, so on a PR it runs merge-commit sources against binaries built from the PR tip. Those trees diverge whenever the PR is behind develop.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e42696a. Configure here.

- name: Set up Node
uses: actions/setup-node@v7
with:
Expand Down
Loading