@@ -127,9 +127,7 @@ jobs:
127127 sudo apt-get install -y hyperfine jq
128128
129129 - name : Configure E2E clone directory
130- # Use the runner's per-job temp dir (emptied at the start/end of each job)
131- # so stale scenario clones from a previous run can't shadow the current
132- # EDR bump. `runner.temp` is unavailable in job-level env:, so set it here.
130+ # Use the runner's temp dir for the scenario clones.
133131 run : echo "E2E_CLONE_DIR=$RUNNER_TEMP/edr-e2e-clones" >> "$GITHUB_ENV"
134132
135133 - name : Compute sentinel versions
@@ -195,6 +193,10 @@ jobs:
195193 # See "Start Verdaccio": bypass pnpm's frozen-lockfile deps check for
196194 # the repoint-desynced workspace.
197195 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN : " false"
196+ # Fresh per-run pnpm metadata cache. The default cache persists on the
197+ # self-hosted runner and would serve a prior run's manifest if the
198+ # version number hasn't changed, so publish/install resolve a stale build.
199+ npm_config_cache_dir : ${{ runner.temp }}/pnpm-metadata-cache
198200 # --force-publish: reuse our already-running Verdaccio (instead of
199201 # erroring) and run the global sinceReleasePublish once up front.
200202 # --use-local: republish the (repointed) hardhat workspace packages and
@@ -336,3 +338,9 @@ jobs:
336338 "workflow_name": "${{ github.workflow }}",
337339 "run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
338340 }
341+
342+ - name : Clean up temp dir
343+ # Self-hosted runners don't automatically wipe RUNNER_TEMP between jobs, so we do
344+ # this manually to avoid polluting future runs.
345+ if : always()
346+ run : rm -rf "$RUNNER_TEMP/edr-e2e-clones" "$RUNNER_TEMP/pnpm-metadata-cache"
0 commit comments