Skip to content

Commit

Permalink
ci: add benchmark (#2)
Browse files Browse the repository at this point in the history
* ci: add benchmark

* ci: install bun and deno

* ci: update bun
  • Loading branch information
wellwelwel authored Aug 23, 2024
1 parent c4a4662 commit 8b086eb
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 4 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci_benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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

- name: ➕ Actions - Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'

- name: ➕ Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-linux-${{ hashFiles('package-lock.json') }}
restore-keys: npm-linux-

- name: ➕ Actions - Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 'latest'

- name: ➕ Actions - Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 'v1.x'

- 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
.DS_Store
deno.lock
/deno.lock
/lib
/browser
/playground
33 changes: 33 additions & 0 deletions benchmark/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions benchmark/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ console.log('› \x1b[1mNode.js\x1b[0m');

console.log(`\n🚀 Fastest is \x1b[1m${fatest}\x1b[0m\n`);

if (!/^lru.min/.test(fatest)) {
if (!/lru.min/.test(fatest)) {
process.exit(1);
}
})
Expand Down Expand Up @@ -79,7 +79,7 @@ console.log('› \x1b[1mBun\x1b[0m');

console.log(`\n🚀 Fastest is \x1b[1m${fatest}\x1b[0m\n`);

if (!/^lru.min/.test(fatest)) {
if (!/lru.min/.test(fatest)) {
process.exit(1);
}
})
Expand Down Expand Up @@ -118,7 +118,7 @@ console.log('› \x1b[1mDeno\x1b[0m');

console.log(`\n🚀 Fastest is \x1b[1m${fatest}\x1b[0m\n`);

if (!/^lru.min/.test(fatest)) {
if (!/lru.min/.test(fatest)) {
process.exit(1);
}
})
Expand Down

0 comments on commit 8b086eb

Please sign in to comment.