зеркало из https://github.com/microsoft/CCF.git
More Bencher yaml fiddling
This commit is contained in:
Родитель
8e229ef238
Коммит
ced706f3fd
|
@ -48,29 +48,49 @@ jobs:
|
|||
unzip $PR_EVENT.zip
|
||||
|
||||
- name: Export PR Event Data
|
||||
id: export
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
let fs = require('fs');
|
||||
let prEvent = JSON.parse(fs.readFileSync(process.env.PR_EVENT, {encoding: 'utf8'}));
|
||||
core.exportVariable("PR_HEAD", `${prEvent.number}/merge`);
|
||||
core.exportVariable("PR_BASE", prEvent.pull_request.base.ref);
|
||||
core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha);
|
||||
core.exportVariable("PR_NUMBER", prEvent.number);
|
||||
if (prEvent.pull_request === undefined) {
|
||||
core.setOutput("is_pr", false);
|
||||
} else {
|
||||
core.setOutput("is_pr", true);
|
||||
core.exportVariable("PR_HEAD", `${prEvent.number}/merge`);
|
||||
core.exportVariable("PR_BASE", prEvent.pull_request.base.ref);
|
||||
core.exportVariable("PR_BASE_SHA", prEvent.pull_request.base.sha);
|
||||
core.exportVariable("PR_NUMBER", prEvent.number);
|
||||
}
|
||||
|
||||
- uses: bencherdev/bencher@main
|
||||
|
||||
- name: Track Benchmarks with Bencher
|
||||
run: |
|
||||
bencher run \
|
||||
--project ccf \
|
||||
--token '${{ secrets.BENCHER_API_TOKEN }}' \
|
||||
--branch '${{ env.PR_HEAD }}' \
|
||||
--branch-start-point '${{ env.PR_BASE }}' \
|
||||
--branch-start-point-hash '${{ env.PR_BASE_SHA }}' \
|
||||
--testbed gha-virtual-ccf-sub \
|
||||
--adapter json \
|
||||
--err \
|
||||
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
|
||||
--ci-number '${{ env.PR_NUMBER }}' \
|
||||
--file "$BENCHMARK_RESULTS"
|
||||
if [[ ${{ steps.export.outputs.is_pr }} == "true" ]];
|
||||
then
|
||||
echo "Uploading PR benchmark results";
|
||||
bencher run \
|
||||
--project ccf \
|
||||
--token '${{ secrets.BENCHER_API_TOKEN }}' \
|
||||
--branch '${{ env.PR_HEAD }}' \
|
||||
--branch-start-point '${{ env.PR_BASE }}' \
|
||||
--branch-start-point-hash '${{ env.PR_BASE_SHA }}' \
|
||||
--testbed gha-virtual-ccf-sub \
|
||||
--adapter json \
|
||||
--err \
|
||||
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
|
||||
--ci-number '${{ env.PR_NUMBER }}' \
|
||||
--file "$BENCHMARK_RESULTS";
|
||||
else
|
||||
echo "Uploading main benchmark results";
|
||||
bencher run \
|
||||
--project ccf \
|
||||
--token '${{ secrets.BENCHER_API_TOKEN }}' \
|
||||
--branch main \
|
||||
--testbed gha-virtual-ccf-sub \
|
||||
--adapter json \
|
||||
--err \
|
||||
--file build/bencher.json
|
||||
fi
|
||||
|
|
Загрузка…
Ссылка в новой задаче