From 3b1f8b7c221a3771a2aba10dabf198f2bf0078c9 Mon Sep 17 00:00:00 2001 From: Stuart Knightley Date: Tue, 14 Jun 2022 17:22:41 -0700 Subject: [PATCH] Add benchmark to PR workflow --- .github/workflows/pr.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 44a22a6f..ba6d24c5 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -35,3 +35,24 @@ jobs: run: npm run lint - name: Test run: npm test + + - name: Benchmark + run: npm run benchmark | tee benchmark.txt + + - name: Download previous benchmark data + uses: actions/cache@v3 + with: + path: ./cache + key: ${{ runner.os }}-benchmark + + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + tool: 'benchmarkjs' + output-file-path: benchmark.txt + external-data-json-path: ./cache/benchmark-data.json + github-token: ${{ secrets.GITHUB_TOKEN }} + alert-threshold: '150%' + comment-on-alert: true + fail-on-alert: true + alert-comment-cc-users: '@Stuk'