diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index d074748c..5ee3366b 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -7,11 +7,14 @@ on: - 'opened' - 'reopened' - 'synchronize' + push: + branches: + - next env: HUSKY: 0 jobs: release: - name: Run npm pack + name: Trigger Workflows runs-on: ubuntu-latest steps: - name: Checkout @@ -26,3 +29,185 @@ jobs: run: npm ci - name: Run validation and tests run: npm pack + + - name: Trigger Workflows + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.WORKFLOW_TRIGGER_SECRET }} + repository: rdkcentral/firebolt-apis + event-type: trigger-workflow + client-payload: '{"OPENRPC_PR_BRANCH": "${{ github.event.pull_request.head.ref }}"}' + + - name: Wait for Triggered Workflow to Initialize + run: | + echo "Waiting for the workflow to initialize..." + sleep 40 + + - name: Get JS Workflow Run ID + run: | + TOKEN="${{ secrets.WORKFLOW_TRIGGER_SECRET }}" + REPO_OWNER="rdkcentral" + REPO_NAME="firebolt-apis" + WORKFLOW_NAME="MFOS standalone sanity report - CORE,MANAGE,DISCOVERY" + MAX_RETRIES=20 + SLEEP_TIME=15 # seconds + + for ((i=0; i> $GITHUB_ENV + break + else + echo "Waiting for JavaScript workflow to start..." + sleep $SLEEP_TIME + fi + done + + # Poll until the C++ SDK workflow run is available + - name: Get CPP Workflow Run ID + run: | + TOKEN="${{ secrets.WORKFLOW_TRIGGER_SECRET }}" + REPO_OWNER="rdkcentral" + REPO_NAME="firebolt-apis" + WORKFLOW_NAME="CXX build" + MAX_RETRIES=20 + SLEEP_TIME=15 # seconds + + for ((i=0; i> $GITHUB_ENV + break + else + echo "Waiting for C++ workflow to start..." + sleep $SLEEP_TIME + fi + done + + - name: Poll Firebolt-api for JavaScript SDK generation + id: poll-javascript-sdk + run: | + TOKEN="${{ secrets.WORKFLOW_TRIGGER_SECRET }}" + REPO_OWNER="rdkcentral" + REPO_NAME="firebolt-apis" + RUN_ID="${{ env.JS_RUN_ID }}" + MAX_POLLS=30 # Max polls before timeout + POLL_INTERVAL=50 # In seconds + + # Poll the specific run ID for status + for ((i=0; i