PR Test for pr-intake #680 #590
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pr-test | |
on: | |
workflow_run: | |
workflows: ["pr-intake"] | |
types: | |
- in_progress | |
run-name: "PR Test for pr-intake #${{ github.event.workflow_run.run_number }}" | |
env: | |
GITHUB_MixedSignalTestLibrary_REPO_OWNER: ${{ github.event.workflow_run.head_repository.owner.login }} | |
GITHUB_MixedSignalTestLibrary_REPO_NAME: ${{ github.event.workflow_run.head_repository.name }} | |
GITHUB_MixedSignalTestLibrary_BRANCH_NAME: ${{ github.event.workflow_run.head_branch }} | |
jobs: | |
build: | |
name: Call Azure Pre Test Pipeline | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check triggering workflow status | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
RUN_ID=${{ github.event.workflow_run.id }} | |
REPO=${{ github.repository }} | |
STATUS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ | |
"https://api.github.com/repos/$REPO/actions/runs/$RUN_ID" | jq -r '.conclusion') | |
echo "Triggering workflow conclusion: $STATUS" | |
if [[ "$STATUS" == "failure" || "$STATUS" == "cancelled" ]]; then | |
echo "Triggering workflow failed or was cancelled. Exiting." | |
exit 1 | |
fi | |
- name: Trigger Azure Pipeline for Unit Test | |
uses: enfa/[email protected] | |
with: | |
azure-devops-project-url: https://ni.visualstudio.com/DevCentral | |
azure-pipeline-name: 'Pre - Mixed Signal Test Library Extensions' | |
azure-devops-token: ${{ secrets.AZURE_DEVOPS_TOKEN }} | |
azure-pipeline-variables: '{"GITHUB_MixedSignalTestLibrary_REPO_OWNER": "${{ env.GITHUB_MixedSignalTestLibrary_REPO_OWNER }}", "GITHUB_MixedSignalTestLibrary_REPO_NAME": "${{ env.GITHUB_MixedSignalTestLibrary_REPO_NAME }}", "GITHUB_MixedSignalTestLibrary_BRANCH_NAME": "${{ env.GITHUB_MixedSignalTestLibrary_BRANCH_NAME }}"}' | |
azure-pipeline-sourcebranch: "refs/heads/main" |