Skip to content

🎯 Perf

🎯 Perf #18

Workflow file for this run

name: 🎯 Perf
on:
push:
branches:
- main
paths:
- 'ds/**'
- 'strat/**'
- 'test/**'
workflow_dispatch:
inputs:
git-ref:
description: "git tip: branch/ref/tag"
required: false
default: 'main'
# docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
js-runtime:
description: "proc: deno/node"
required: false
default: 'node'
type: choice
options:
- node
- deno
env:
GIT_REF: ${{ github.event.inputs.git-ref || github.ref }}
JS_RUNTIME: 'node'
NODE_VER: '24.x'
DENO_VER: '2.x'
jobs:
lfu-perf:
name: Lfu Perf
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ env.GIT_REF }}
- name: Determine runtime
run: |
echo "JS_RUNTIME=${JSR}" >> $GITHUB_ENV
shell: bash
env:
JSR: ${{ github.event.inputs.js-runtime || env.JS_RUNTIME }}
# docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python
- name: Install Node @v19
if: env.JS_RUNTIME == 'node'
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
# deno.com/blog/deploy-static-files#example-a-statically-generated-site
- name: Install Deno @1.29
if: env.JS_RUNTIME == 'deno'
uses: denoland/setup-deno@main
with:
deno-version: ${{ env.DENO_VER }}
- name: Setup Node
if: env.JS_RUNTIME == 'node'
run: |
echo "JS_RUNTIME=${JS_RUNTIME} --max-old-space-size=8000" >> $GITHUB_ENV
npm i && npm run build --if-present
# docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value
- name: Sanity
if: success()
run: |
$JS_RUNTIME ./test/lfu-test.js
shell: bash
- name: DS Perf
if: success()
run: |
$JS_RUNTIME ./test/ds-perf.js
shell: bash
- name: Strat Perf
if: success()
run: |
$JS_RUNTIME ./test/strat-perf.js
shell: bash