Files
planetiler-openmaptiles/.github/workflows/update-pr.yml
dependabot[bot] 488e5c6588 Bump dawidd6/action-download-artifact from 3 to 4 (#169)
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 3 to 4.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 13:48:18 +02:00

89 lines
2.8 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# This workflow posts the result of a performance test back to the pull request as a comment.
# Needs to be separate from CI because it has elevated privileges so only runs from main branch.
name: Update PR
on:
workflow_run:
workflows: [ "Performance" ]
types:
- completed
jobs:
updatepr:
runs-on: ubuntu-latest
continue-on-error: true
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 5
steps:
# report status back to pull request
- uses: haya14busa/action-workflow_run-status@v1
- uses: actions/checkout@v4
- name: 'Download branch build info'
uses: dawidd6/action-download-artifact@v4
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: build-info
path: build-info
- name: 'Get build info'
id: build_info
run: echo "::set-output name=pr_number::$(cat build-info/pull_request_number)"
- name: 'Build comment-body'
run: |
cat build-info/branchlogs.txt | sed -n '/^.*Tile stats/,$p' > branchsummary.txt
cat build-info/branchlogs.txt | sed -n '/^.*Exception in thread/,$p' >> branchsummary.txt
cat build-info/baselogs.txt | sed -n '/^.*Tile stats:/,$p' > basesummary.txt
cat build-info/baselogs.txt | sed -n '/^.*Exception in thread/,$p' >> basesummary.txt
cat << EOF > comment-body.txt
<table>
<thead>
<tr>
<th>Base $(cat build-info/base_sha)</th>
<th>This Branch $(cat build-info/branch_sha)</th>
</tr>
</thead>
<tr>
<td>
\`\`\`
$(cat basesummary.txt)
\`\`\`
</td>
<td>
\`\`\`
$(cat build-info/branchlogs.txt | sed -n '/^.*Tile stats:/,$p')
\`\`\`
</td>
</tr>
</table>
https://github.com/openmaptiles/planetiler-openmaptiles/actions/runs/${{ github.event.workflow_run.id }}
<details><summary> <strong>Base Logs $(cat build-info/base_sha)</strong></summary>
\`\`\`
$(cat build-info/baselogs.txt)
\`\`\`
</details>
<details><summary> <strong>This Branch Logs $(cat build-info/branch_sha)</strong></summary>
\`\`\`
$(cat build-info/branchlogs.txt)
\`\`\`
</details>
EOF
- name: 'Dump comment body'
run: cat comment-body.txt
- uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: comment-body.txt
header: performance-tests
number: ${{ steps.build_info.outputs.pr_number }}