-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
666 changed files
with
13,910 additions
and
6,111 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Post any reports generated by benchmarks_run.yml . | ||
# Separated for security: | ||
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
|
||
name: benchmarks-report | ||
run-name: Report benchmark results | ||
|
||
on: | ||
workflow_run: | ||
workflows: [benchmarks-run] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
download: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
reports_exist: ${{ steps.unzip.outputs.reports_exist }} | ||
steps: | ||
- name: Download artifact | ||
id: download-artifact | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id, | ||
}); | ||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "benchmark_reports" | ||
})[0]; | ||
if (typeof matchArtifact != 'undefined') { | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
let fs = require('fs'); | ||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/benchmark_reports.zip`, Buffer.from(download.data)); | ||
}; | ||
- name: Unzip artifact | ||
id: unzip | ||
run: | | ||
if test -f "benchmark_reports.zip"; then | ||
reports_exist=1 | ||
unzip benchmark_reports.zip -d benchmark_reports | ||
else | ||
reports_exist=0 | ||
fi | ||
echo "reports_exist=$reports_exist" >> "$GITHUB_OUTPUT" | ||
- name: Store artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: benchmark_reports | ||
path: benchmark_reports | ||
|
||
post_reports: | ||
runs-on: ubuntu-latest | ||
needs: download | ||
if: needs.download.outputs.reports_exist == 1 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: benchmark_reports | ||
path: .github/workflows/benchmark_reports | ||
|
||
- name: Set up Python | ||
# benchmarks/bm_runner.py only needs builtins to run. | ||
uses: actions/setup-python@v4 | ||
|
||
- name: Post reports | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: python benchmarks/bm_runner.py _gh_post |
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
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
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
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
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
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
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
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
Oops, something went wrong.