mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-02 15:25:54 +00:00
chore(bencher): update bencher CLI usage (#1470)
This commit is contained in:
parent
abe2f27328
commit
0a47ebd94b
49
.github/workflows/bench_track_fork_pr.yml
vendored
49
.github/workflows/bench_track_fork_pr.yml
vendored
@ -18,43 +18,22 @@ jobs:
|
|||||||
PR_EVENT: event.json
|
PR_EVENT: event.json
|
||||||
steps:
|
steps:
|
||||||
- name: Download Benchmark Results
|
- name: Download Benchmark Results
|
||||||
uses: actions/github-script@v7
|
uses: dawidd6/action-download-artifact@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
name: ${{ env.BENCHMARK_RESULTS }}
|
||||||
async function downloadArtifact(artifactName) {
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
- name: Download PR Event
|
||||||
owner: context.repo.owner,
|
uses: dawidd6/action-download-artifact@v6
|
||||||
repo: context.repo.repo,
|
with:
|
||||||
run_id: context.payload.workflow_run.id,
|
name: ${{ env.PR_EVENT }}
|
||||||
});
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
|
|
||||||
return artifact.name == artifactName
|
|
||||||
})[0];
|
|
||||||
if (!matchArtifact) {
|
|
||||||
core.setFailed(`Failed to find artifact: ${artifactName}`);
|
|
||||||
}
|
|
||||||
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}/${artifactName}.zip`, Buffer.from(download.data));
|
|
||||||
}
|
|
||||||
await downloadArtifact(process.env.BENCHMARK_RESULTS);
|
|
||||||
await downloadArtifact(process.env.PR_EVENT);
|
|
||||||
- name: Unzip Benchmark Results
|
|
||||||
run: |
|
|
||||||
unzip $BENCHMARK_RESULTS.zip
|
|
||||||
unzip $PR_EVENT.zip
|
|
||||||
- name: Export PR Event Data
|
- name: Export PR Event Data
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
let fs = require('fs');
|
let fs = require('fs');
|
||||||
let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'}));
|
let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'}));
|
||||||
core.exportVariable("PR_HEAD", `${prEvent.number}/merge`);
|
core.exportVariable("PR_HEAD", prEvent.pull_request.head.ref);
|
||||||
core.exportVariable("PR_BASE", prEvent.pull_request.base.ref);
|
core.exportVariable("PR_BASE", prEvent.pull_request.base.ref);
|
||||||
core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha);
|
core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha);
|
||||||
core.exportVariable("PR_NUMBER", prEvent.number);
|
core.exportVariable("PR_NUMBER", prEvent.number);
|
||||||
@ -64,12 +43,14 @@ jobs:
|
|||||||
bencher run \
|
bencher run \
|
||||||
--project ratatui-org \
|
--project ratatui-org \
|
||||||
--token '${{ secrets.BENCHER_API_TOKEN }}' \
|
--token '${{ secrets.BENCHER_API_TOKEN }}' \
|
||||||
--branch '${{ env.PR_HEAD }}' \
|
--branch "$PR_HEAD" \
|
||||||
--branch-start-point '${{ env.PR_BASE }}' \
|
--start-point "$PR_BASE" \
|
||||||
--branch-start-point-hash '${{ env.PR_BASE_SHA }}' \
|
--start-point-hash "$PR_BASE_SHA" \
|
||||||
|
--start-point-clone-thresholds \
|
||||||
|
--start-point-reset \
|
||||||
--testbed ubuntu-latest \
|
--testbed ubuntu-latest \
|
||||||
--adapter rust_criterion \
|
--adapter rust_criterion \
|
||||||
--err \
|
--err \
|
||||||
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
|
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
|
||||||
--ci-number '${{ env.PR_NUMBER }}' \
|
--ci-number "$PR_NUMBER" \
|
||||||
--file "$BENCHMARK_RESULTS"
|
--file "$BENCHMARK_RESULTS"
|
Loading…
x
Reference in New Issue
Block a user