-
-
Notifications
You must be signed in to change notification settings - Fork 14
84 lines (70 loc) · 2.42 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: '🎖️ CI — Benchmark'
on:
pull_request:
workflow_dispatch:
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
name: Compare
steps:
- name: ➕ Actions - Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: ➕ Actions - Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: ➕ Actions - Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun-version }}
- name: ➕ Actions — Setup Hyperfine
run: cargo install --locked hyperfine
- name: ➕ Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-linux-${{ hashFiles('package-lock.json') }}
restore-keys: npm-linux-
- name: ➕ Cache dependencies (Benchmark)
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-benchmark-${{ hashFiles('benchmark/package-lock.json') }}
restore-keys: npm-benchmark-
- name: 📦 Installing Dependencies
run: npm ci
- name: 🚀 Building Poku
run: npm run build
- name: 🎖️ Rock it
run: npm run benchmark
# - name: Find Comment
# uses: peter-evans/find-comment@v3
# id: fc
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-author: 'github-actions[bot]'
# body-includes: Benchmark Results
# - name: 🤖 Actions - Creating Comment
# if: steps.fc.outputs.comment-id == ''
# uses: peter-evans/create-or-update-comment@v4
# with:
# issue-number: ${{ github.event.pull_request.number }}
# body-path: './benchmark/output.md'
# - name: 🤖 Actions - Updating Comment
# if: steps.fc.outputs.comment-id != ''
# uses: peter-evans/create-or-update-comment@v4
# with:
# comment-id: ${{ steps.fc.outputs.comment-id }}
# issue-number: ${{ github.event.pull_request.number }}
# edit-mode: replace
# body-path: './benchmark/output.md'
- name: 🐷 Ensure Poku
run: |
cd benchmark
SHORT_SHA=$(git rev-parse --short HEAD)
jq -e ".results | sort_by(.mean) | .[0].command == \"🐷 Poku ($SHORT_SHA)\"" results.json