Changeset - r25426:c16276cd8dc0
[Not reviewed]
master
0 1 0
Loïc Guilloux - 3 years ago 2021-05-10 12:48:04
glx22@users.noreply.github.com
Add: [Actions] Check CI annotations to detect compile warnings (#9217)
1 file changed with 42 insertions and 0 deletions:
0 comments (0 inline, 0 general)
.github/workflows/ci-build.yml
Show inline comments
 
@@ -315,3 +315,45 @@ jobs:
 
      run: |
 
        cd ${GITHUB_WORKSPACE}/build
 
        ctest --timeout 120
 

	
 
  check_annotations:
 
    name: Check Annotations
 
    needs:
 
    - emscripten
 
    - linux
 
    - macos
 
    - windows
 

	
 
    if: always() && github.event_name == 'pull_request'
 

	
 
    runs-on: ubuntu-20.04
 

	
 
    steps:
 
    - name: Get check suite ID
 
      id: check_suite_id
 
      uses: octokit/request-action@v2.x
 
      with:
 
        route: GET /repos/{repository}/actions/runs/{run_id}
 
        repository: ${{ github.repository }}
 
        run_id: ${{ github.run_id }}
 
      env:
 
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 

	
 
    - name: Get check runs
 
      id: check_runs
 
      uses: octokit/request-action@v2.x
 
      with:
 
        route: GET /repos/{repository}/check-suites/{check_suite_id}/check-runs
 
        repository: ${{ github.repository }}
 
        check_suite_id: ${{ fromJson(steps.check_suite_id.outputs.data).check_suite_id }}
 
      env:
 
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 

	
 
    - name: Check annotations
 
      shell: bash
 
      run: |
 
        echo '[
 
        ${{ toJson(fromJson(steps.check_runs.outputs.data).check_runs.*.output.title) }}, ${{ toJson(fromJson(steps.check_runs.outputs.data).check_runs.*.output.summary) }}
 
        ]' | jq '.[0] as $t | .[1] as $s | reduce range(.[0] | length) as $i ([]; . + [if $t[$i] then $t[$i] + ": " + $s[$i] else empty end]) | .[]'
 

	
 
        exit $(echo '${{ toJson(fromJson(steps.check_runs.outputs.data).check_runs.*.output.annotations_count) }}' | jq 'add')
0 comments (0 inline, 0 general)