-
-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (62 loc) · 2.08 KB
/
ci-benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: "CI: Benchmark"
on: [pull_request]
jobs:
benchmark:
name: Benchmark
if: "!(contains(github.event.head_commit.message, '[skip_ci]'))"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
node: [14]
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "[INIT] Setup Node.js ${{ matrix.node }}"
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: "[INIT] Restore dependency cache"
id: cache-restore
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
- name: "[INIT] Install dependencies"
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: npm ci
- name: "[INIT] Build"
run: npm run build
- name: "[INIT] Download previous benchmark data"
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: "[EXEC] Benchmark"
run: npm run --silent bench | tee .benchmarks/output.txt
- name: "[POST] Store benchmark results"
uses: rhysd/github-action-benchmark@v1
with:
name: Petitio
tool: "benchmarkjs"
output-file-path: .benchmarks/output.txt
external-data-json-path: ./cache/benchmark-data.json
alert-threshold: "200%"
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-comment-cc-users: "@tbnritzdoge @nytelife26"
comment-on-alert: true
fail-on-alert: true
- name: "[POST] Push benchmark results"
if: github.event_name != 'pull_request'
run: |
git config user.name 'Kludge Cyber Systems (CI)'
git config user.email [email protected]
git add .benchmarks
git commit --no-verify -m 'chore: update benchmarks' || true
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}