66 lines
2.4 KiB
YAML
66 lines
2.4 KiB
YAML
name: Trigger Playwright E2E Tests
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
paths:
|
|
- "ui-next/**"
|
|
- ".github/workflows/playwright-e2e.yml"
|
|
workflow_dispatch:
|
|
inputs:
|
|
conductor_ui_branch:
|
|
description: "conductor-ui branch to test against"
|
|
required: false
|
|
default: "main"
|
|
|
|
# The commit status key used both here (to set pending) and in conductor-ui
|
|
# (to post the final result). Must be identical in both places.
|
|
env:
|
|
STATUS_CONTEXT: "playwright-e2e / conductor-ui"
|
|
|
|
jobs:
|
|
dispatch:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
statuses: write
|
|
steps:
|
|
- name: Resolve conductor-ui branch from PR body
|
|
id: resolve
|
|
run: |
|
|
if [ -n "${{ inputs.conductor_ui_branch }}" ]; then
|
|
echo "branch=${{ inputs.conductor_ui_branch }}" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
BODY=$(cat <<'PRBODY'
|
|
${{ github.event.pull_request.body }}
|
|
PRBODY
|
|
)
|
|
PARSED=$(echo "$BODY" | grep -oP '(?<=conductor-ui-branch:\s).+' | head -1 | xargs)
|
|
if [ -n "$PARSED" ]; then
|
|
echo "branch=$PARSED" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "branch=main" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
# Own-repo statuses: use GITHUB_TOKEN. The cross-repo PAT lacks write access here.
|
|
- name: Set commit status → pending
|
|
run: |
|
|
gh api "repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha || github.sha }}" \
|
|
-f state=pending \
|
|
-f context="${{ env.STATUS_CONTEXT }}" \
|
|
-f description="Waiting for Playwright E2E tests…" \
|
|
-f target_url="https://github.com/orkes-io/conductor-ui/actions"
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Trigger Playwright tests in conductor-ui
|
|
run: |
|
|
gh api repos/orkes-io/conductor-ui/dispatches \
|
|
-f event_type=oss-pr-playwright \
|
|
-f "client_payload[oss_ref]=${{ github.event.pull_request.head.sha || github.sha }}" \
|
|
-f "client_payload[oss_pr_number]=${{ github.event.pull_request.number || '' }}" \
|
|
-f "client_payload[oss_pr_title]=${{ github.event.pull_request.title || 'manual dispatch' }}" \
|
|
-f "client_payload[conductor_ui_branch]=${{ steps.resolve.outputs.branch }}"
|
|
env:
|
|
GH_TOKEN: ${{ secrets.ORKES_INTERNAL_RUNNER_SECRET }}
|