ci: add git reset before store benchmark (#2938)

This commit is contained in:
Jonathan Ho
2023-04-01 19:25:01 -07:00
committed by GitHub
parent 9c7b2b832e
commit 782a778a1d
2 changed files with 16 additions and 14 deletions

View File

@@ -56,7 +56,7 @@ jobs:
- name: Benchmark
if: ${{ steps.cpuCheck.outputs.match == 'true' }}
run: node --expose-gc ./packages/benchmark/dist/index.js | tee output.txt
- name: Download previous benchmark data
if: ${{ steps.cpuCheck.outputs.match == 'true' }}
uses: actions/cache@v3
@@ -70,23 +70,12 @@ jobs:
tool: "benchmarkjs"
output-file-path: output.txt
external-data-json-path: benchmarksResult/data.json
- uses: actions/upload-artifact@v3
if: ${{ steps.cpuCheck.outputs.match == 'true' }}
with:
name: benchmarkResults
path: benchmarksResult/data.json
- name: Store benchmark result (Main)
uses: benchmark-action/github-action-benchmark@v1
if: ${{ github.ref == 'refs/heads/main' && steps.cpuCheck.outputs.match == 'true' }}
with:
tool: "benchmarkjs"
output-file-path: output.txt
gh-pages-branch: "benchies"
benchmark-data-dir-path: benchmarksResult
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
- name: Save Commmit SHA
if: ${{ steps.cpuCheck.outputs.match == 'true' }}
run: |
@@ -98,3 +87,16 @@ jobs:
with:
name: commitData
path: commitData/
- name: remove changes
run: git reset --hard HEAD
- name: Store benchmark result (Main)
uses: benchmark-action/github-action-benchmark@v1
if: ${{ github.ref == 'refs/heads/main' && steps.cpuCheck.outputs.match == 'true' }}
with:
tool: "benchmarkjs"
output-file-path: output.txt
gh-pages-branch: "benchies"
benchmark-data-dir-path: benchmarksResult
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true