ci: delay Web E2E until PR image validate window elapses
Replace flaky gh polling with a PR-only wait job (35 min) so Vite does not share the host with buildkit validate on single-runner setups. Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
parent
b5249acbd1
commit
1ba0b4e6f9
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -208,11 +208,18 @@ jobs:
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm test:integration
|
||||
|
||||
wait-pr-image-validate:
|
||||
name: Wait for PR image validate
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: [self-hosted, evoo-ci, Linux]
|
||||
timeout-minutes: 75
|
||||
steps:
|
||||
- name: Let publish-server-image validate finish on this host
|
||||
run: sleep 2100
|
||||
|
||||
test-e2e:
|
||||
name: Web E2E
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
needs: [lint, check, build, test, test-integration, wait-pr-image-validate]
|
||||
uses: ./.github/workflows/playwright.yml
|
||||
with:
|
||||
upload_artifacts: true
|
||||
|
||||
40
.github/workflows/playwright.yml
vendored
40
.github/workflows/playwright.yml
vendored
@ -54,52 +54,12 @@ jobs:
|
||||
playwright:
|
||||
name: Web E2E
|
||||
runs-on: [self-hosted, evoo-ci, Linux]
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
timeout-minutes: 60
|
||||
concurrency:
|
||||
group: ${{ inputs.publish_report && 'playwright-publication' || format('playwright-{0}', github.run_id) }}
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Wait for PR image validate on shared self-hosted runners
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'workflow_call'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
shas=("${GITHUB_SHA}")
|
||||
if [[ -n "${PR_HEAD_SHA}" ]]; then
|
||||
shas+=("${PR_HEAD_SHA}")
|
||||
fi
|
||||
run_id=""
|
||||
for sha in "${shas[@]}"; do
|
||||
run_id="$(gh run list --repo "${GITHUB_REPOSITORY}" --commit "${sha}" \
|
||||
--workflow publish-server-image.yml --limit 1 \
|
||||
--json databaseId -q '.[0].databaseId // empty')"
|
||||
if [[ -n "${run_id}" ]]; then
|
||||
echo "Found publish-server-image run ${run_id} for commit ${sha}."
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ -z "${run_id}" ]]; then
|
||||
echo "No publish-server-image run for ${shas[*]}; continuing."
|
||||
exit 0
|
||||
fi
|
||||
echo "Waiting for publish-server-image before starting Vite…"
|
||||
for attempt in $(seq 1 120); do
|
||||
status="$(gh run view "${run_id}" --repo "${GITHUB_REPOSITORY}" --json status -q .status)"
|
||||
if [[ "${status}" == "completed" ]]; then
|
||||
echo "publish-server-image run ${run_id} completed."
|
||||
exit 0
|
||||
fi
|
||||
echo "Attempt ${attempt}/120: publish-server-image still ${status}…"
|
||||
sleep 30
|
||||
done
|
||||
echo "Timed out waiting for publish-server-image (60 min)" >&2
|
||||
exit 1
|
||||
- uses: pnpm/action-setup@v4
|
||||
id: pnpm-setup
|
||||
with:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user