Add CI stuff
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
push:
|
||||
tags:
|
||||
- 'bench-*'
|
||||
|
||||
concurrency:
|
||||
group: bench-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.bun/install/cache
|
||||
key: bun-${{ hashFiles('bun.lockb') }}
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun test
|
||||
|
||||
benchmark:
|
||||
if: startsWith(github.ref, 'refs/tags/perf-')
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
runtime: [bun, deno]
|
||||
max-parallel: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.bun/install/cache
|
||||
key: bun-${{ hashFiles('bun.lockb') }}
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run bench/index.ts --json > result-${{ matrix.runtime }}.json
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bench-results-${{ matrix.runtime }}
|
||||
path: result-${{ matrix.runtime }}.json
|
||||
@@ -13,9 +13,7 @@ export function sweepInterval(
|
||||
max: number,
|
||||
): Span | null {
|
||||
if (v === 0) {
|
||||
return min <= p && p <= max
|
||||
? { entry: -Infinity, exit: Infinity }
|
||||
: null;
|
||||
return min <= p && p <= max ? { entry: -Infinity, exit: Infinity } : null;
|
||||
}
|
||||
|
||||
let t1 = (min - p) / v;
|
||||
|
||||
@@ -14,9 +14,7 @@ export function sweepInterval(
|
||||
max: number,
|
||||
): Span | null {
|
||||
if (v === 0) {
|
||||
return min <= p && p <= max
|
||||
? { entry: -Infinity, exit: Infinity }
|
||||
: null;
|
||||
return min <= p && p <= max ? { entry: -Infinity, exit: Infinity } : null;
|
||||
}
|
||||
|
||||
let t1 = (min - p) / v;
|
||||
|
||||
@@ -20,9 +20,7 @@ export function sweepInterval(
|
||||
max: number,
|
||||
): Span | null {
|
||||
if (v === 0) {
|
||||
return min <= p && p <= max
|
||||
? { entry: -Infinity, exit: Infinity }
|
||||
: null;
|
||||
return min <= p && p <= max ? { entry: -Infinity, exit: Infinity } : null;
|
||||
}
|
||||
let t1 = (min - p) / v;
|
||||
let t2 = (max - p) / v;
|
||||
|
||||
Reference in New Issue
Block a user