Performance Tests Comment #5187
This file contains 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: "Performance Tests Comment" | |
on: | |
workflow_run: | |
workflows: ["Performance Tests"] | |
types: | |
- completed | |
jobs: | |
performance-tests-comment: | |
if: github.event.workflow_run.conclusion == 'success' | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Download performance report" | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
script: | | |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
run_id: ${{ github.event.workflow_run.id }}, | |
}); | |
var matchArtifact = artifacts.data.artifacts.filter((artifact) => { | |
return artifact.name == "performance" | |
})[0]; | |
var download = await github.rest.actions.downloadArtifact({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
artifact_id: matchArtifact.id, | |
archive_format: 'zip', | |
}); | |
var fs = require('fs'); | |
fs.writeFileSync('${{ github.workspace }}/performance.zip', Buffer.from(download.data)); | |
- run: unzip performance.zip | |
- id: get-pr-number | |
run: | | |
number=$(<prnumber) | |
case "$number" in ''|*[!0-9]*) echo "Provided PR number is not an integer"; exit 1 ;; esac | |
echo "pr-number=$number" >> "$GITHUB_OUTPUT" | |
- name: Comment on PR | |
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0 | |
with: | |
number: ${{ steps.get-pr-number.outputs.pr-number }} | |
header: performance | |
path: ./performanceReport | |
GITHUB_TOKEN: ${{ secrets.NEO4J_TEAM_GRAPHQL_PERSONAL_ACCESS_TOKEN }} |