Skip to content

report-build-and-test #787

report-build-and-test

report-build-and-test #787

# Copyright (c) 2022 The Orbit Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
name: report-build-and-test
on:
workflow_run:
workflows: ['build-and-test']
types:
- completed
permissions: read-all
jobs:
report-tests:
permissions:
checks: write
statuses: write
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 #v1.6.0
with:
artifact: /test-results-(.*)-(.*)/
name: '$2 $1 Test Results'
path: '**/*.xml'
reporter: java-junit
report-clang-tidy-diff:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Download PR metadata
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: ''
name: pr_metadata
if_no_artifact_found: 'ignore'
- name: Download clang_tidy_fixes
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: ''
name: clang_tidy_fixes
if_no_artifact_found: 'ignore'
- name: Set found_files
id: set_found_files
run: |
if [ -f clang-tidy-fixes.yml ] && [ -f pr_number.txt ] && [ -f pr_head_repo.txt ] && [ -f pr_head_ref.txt ]; then
echo "found_files=true" >> $GITHUB_OUTPUT
else
echo "found_files=false" >> $GITHUB_OUTPUT
fi
- run: |
echo "PR_NUMBER=$(cat pr_number.txt | jq -r .)" >> $GITHUB_ENV
echo "PR_HEAD_REPO=$(cat pr_head_repo.txt | jq -Rr .)" >> $GITHUB_ENV
echo "PR_HEAD_REF=$(cat pr_head_ref.txt | jq -Rr .)" >> $GITHUB_ENV
if: steps.set_found_files.outputs.found_files == 'true'
- uses: actions/checkout@v3
if: steps.set_found_files.outputs.found_files == 'true'
with:
repository: ${{ env.PR_HEAD_REPO }}
ref: ${{ env.PR_HEAD_REF }}
persist-credentials: false
- name: Redownload clang_tidy_fixes
if: steps.set_found_files.outputs.found_files == 'true'
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: ''
name: clang_tidy_fixes
if_no_artifact_found: 'ignore'
- uses: platisd/clang-tidy-pr-comments@master
if: steps.set_found_files.outputs.found_files == 'true'
with:
github_token: ${{ secrets.ORBITPROFILER_BOT_PAT }}
clang_tidy_fixes: clang-tidy-fixes.yml
pull_request_id: ${{ env.PR_NUMBER }}