Skip to content

Modified git hub flow to support exteranl trigger events #353

Modified git hub flow to support exteranl trigger events

Modified git hub flow to support exteranl trigger events #353

name: MFOS standalone sanity report - CORE, MANAGE, DISCOVERY
on:
repository_dispatch:
types: [trigger-workflow]
pull_request:
types:
- opened
- synchronize
branches: [ next ]
push:
branches:
- next
jobs:
RunStandaloneTests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Set the branch if the workflow is triggered from external
- name: Set PR Branch based on the trigger
id: set-pr-branch
run: |
if [ "${{ github.event_name }}" == "repository_dispatch" ]; then
echo "OPENRPC_PR_BRANCH='${{ github.event.client_payload.OPENRPC_PR_BRANCH }}'" >> $GITHUB_ENV # Set from payload
else
echo "OPENRPC_PR_BRANCH=''" >> $GITHUB_ENV # Clear the variable for other events
fi
# Run tests
- name: Run Core Manage and Discovery tests and create assets
env:
EVENT_NAME: ${{ github.event_name }}
GITHUB_REF: ${{ github.ref }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
INTENT: ${{ vars.INTENT }}
OPENRPC_PR_BRANCH: ${{ env.OPENRPC_PR_BRANCH }} # Comes from OPENRPC repo if triggered externally
run: |
./.github/workflows/utils.sh runTests
- name: Upload report.json as an artifact
uses: actions/upload-artifact@v4
with:
name: report
path: ${{ github.workspace }}/report
- name: Get results from report.json
run: |
./.github/workflows/utils.sh getResults