mirror of
https://github.com/django-components/django-components.git
synced 2025-11-26 00:41:54 +00:00
refactor: same PR number to a file to access it when posting a benchmark comment (#1029)
This commit is contained in:
parent
99067c4b20
commit
439fcf68e0
2 changed files with 6 additions and 1 deletions
3
.github/workflows/pr-benchmark-comment.yml
vendored
3
.github/workflows/pr-benchmark-comment.yml
vendored
|
|
@ -86,6 +86,7 @@ jobs:
|
|||
script: |
|
||||
const fs = require('fs');
|
||||
const results = fs.readFileSync('./benchmark_results.md', 'utf8');
|
||||
const issue_number = Number.parseInt(fs.readFileSync('./pr_number.txt', 'utf8'));
|
||||
const body = `## Performance Benchmark Results\n\nComparing PR changes against master branch:\n\n${results}`;
|
||||
|
||||
// See https://octokit.github.io/rest.js/v21/#issues-create-comment
|
||||
|
|
@ -94,5 +95,5 @@ jobs:
|
|||
// See https://github.com/actions/toolkit/blob/662b9d91f584bf29efbc41b86723e0e376010e41/packages/github/src/context.ts#L66
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.payload.workflow_run.pull_requests[0].number,
|
||||
issue_number: issue_number,
|
||||
});
|
||||
|
|
|
|||
4
.github/workflows/pr-benchmark-generate.yml
vendored
4
.github/workflows/pr-benchmark-generate.yml
vendored
|
|
@ -93,6 +93,10 @@ jobs:
|
|||
echo "Comparing benchmarks..."
|
||||
mkdir -p pr
|
||||
asv compare upstream/master HEAD --factor 1.1 --split > ./pr/benchmark_results.md
|
||||
|
||||
# Save the PR number to a file, so that it can be used by the next step.
|
||||
echo "${{ github.event.pull_request.number }}" > ./pr/pr_number.txt
|
||||
|
||||
echo "Benchmarks comparison DONE."
|
||||
|
||||
- name: Save benchmark results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue