From 15132d848b0675b9a788f6de435214638f1dbc57 Mon Sep 17 00:00:00 2001 From: "Kandasamy, Divya" Date: Tue, 8 Oct 2024 15:41:46 -0400 Subject: [PATCH] Updated utils.sh --- .github/workflows/run-standalone-mfos-tests.yml | 4 ++-- .github/workflows/utils.sh | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-standalone-mfos-tests.yml b/.github/workflows/run-standalone-mfos-tests.yml index d5f85a18a..da2013a72 100644 --- a/.github/workflows/run-standalone-mfos-tests.yml +++ b/.github/workflows/run-standalone-mfos-tests.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - # set the branch if the workflow is triggered from external + # set the branch if the workflow is triggered from external - name: Set PR Branch based on the trigger id: set-pr-branch run: | @@ -47,4 +47,4 @@ jobs: - name: Get results from report.json run: | - ./.github/workflows/util.sh getResults + ./.github/workflows/utils.sh getResults diff --git a/.github/workflows/utils.sh b/.github/workflows/utils.sh index d5117de77..d11a5c7cf 100755 --- a/.github/workflows/utils.sh +++ b/.github/workflows/utils.sh @@ -32,6 +32,13 @@ function runTests(){ git clone --branch ${PR_BRANCH} https://github.com/rdkcentral/firebolt-apis.git echo "cd to firebolt-apis repo and compile firebolt-open-rpc.json" cd firebolt-apis + if [ "$EVENT_NAME" == "workflow_dispatch" ]; then + # If OPENRPC_PR_BRANCH is set and is not 'next' + if [ -n "$OPENRPC_PR_BRANCH" ] && [ "$OPENRPC_PR_BRANCH" != "next" ]; then + echo "Updating OpenRPC dependency to branch: $OPENRPC_PR_BRANCH" + jq ".dependencies[\"@firebolt-js/openrpc\"] = \"file:../firebolt-openrpc#$OPENRPC_PR_BRANCH\"" package.json > package.json.tmp && mv package.json.tmp package.json + fi + fi npm i npm run compile npm run dist @@ -77,7 +84,7 @@ function runTests(){ const fs = require("fs"); (async () => { const browser = await puppeteer.launch({ headless: true, args: ["--no-sandbox", "--disable-gpu"] }); - const page = await browser.newPage(); + const page = await browser.newPage(); // Enable console logging page.on("console", (msg) => {