1 # This workflow is triggered whenever "Caller CoreValidation" workflow is completed (which is called by PR).
2 # This workflow ideally should be triggered also by PR, but forked PR has limited permissions which does not
3 # allow to use `configure-aws-credentials` actions and using secrets.
4 # It will update its status back to the caller PR as "CoreValidation" check name
9 - Caller CoreValidation
13 # The env variables relate to an ARM AWS account for CMSIS_5
14 # If you are forking CMSIS_5 repo, please use your own info.
16 AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
17 AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
18 AWS_IAM_PROFILE: ${{ secrets.AWS_IAM_PROFILE }}
19 AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
20 AWS_SECURITY_GROUP_ID: ${{ secrets.AWS_SECURITY_GROUP_ID }}
21 AWS_SUBNET_ID: ${{ secrets.AWS_SUBNET_ID }}
24 set_pending_status_to_pr:
25 runs-on: ubuntu-latest
27 - name: Set a pending status to the PR
29 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
33 --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
34 --header 'content-type: application/json' \
37 "context": "CoreValidation",
38 "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
43 runs-on: ubuntu-latest
44 needs: set_pending_status_to_pr
49 avhresult: ${{ steps.avh.conclusion }}
50 testbadge: ${{ steps.avh.outputs.badge }}
52 - name: Download workflow artifact
53 uses: dawidd6/action-download-artifact@v2
55 github_token: ${{ secrets.GITHUB_TOKEN }}
56 workflow: caller-corevalidation.yml
57 run_id: ${{ github.event.workflow_run.id }}
59 - name: Read the pr_num file
61 uses: juliangruber/read-file-action@v1.1.6
63 path: ./pr_number/pr_number
66 - name: Clone this repo
67 uses: actions/checkout@v3
73 GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
75 gh pr checkout ${{ steps.pr_num_reader.outputs.content }}
77 - name: Set up Python 3.10
78 uses: actions/setup-python@v4
80 python-version: '3.10'
82 - name: Install AVH Client for Python
84 pip install git+https://github.com/ARM-software/avhclient.git@v0.1
86 - uses: ammaraskar/gcc-problem-matcher@master
88 - name: Configure AWS Credentials
89 uses: aws-actions/configure-aws-credentials@v1-node16
91 role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
92 aws-region: ${{ env.AWS_DEFAULT_REGION }}
97 avhclient -b aws execute --specfile CMSIS/CoreValidation/Project/avh.yml
99 - name: Archive build results
100 uses: actions/upload-artifact@v3
103 path: CMSIS/CoreValidation/Project/Core_Validation-*.zip
105 if-no-files-found: error
108 - name: Archive test results
109 uses: actions/upload-artifact@v3
112 path: CMSIS/CoreValidation/Project/Core_Validation-*.junit
114 if-no-files-found: error
117 - name: Archive event file
118 uses: actions/upload-artifact@v3
121 path: ${{ github.event_path }}
123 set_success_status_to_pr:
124 runs-on: ubuntu-latest
128 - name: Set success status to the PR
130 GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
132 curl --request POST \
133 --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
134 --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
135 --header 'content-type: application/json' \
138 "context": "CoreValidation",
139 "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
143 set_failure_status_to_pr:
144 runs-on: ubuntu-latest
148 - name: Set failure status to the PR
150 GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
152 curl --request POST \
153 --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
154 --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
155 --header 'content-type: application/json' \
158 "context": "CoreValidation",
159 "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"