Skip to content

Commit

Permalink
Merge pull request #7 from simoneb/main
Browse files Browse the repository at this point in the history
chore: support windows
  • Loading branch information
ShogunPanda authored Jan 19, 2025
2 parents 460ff2b + 7435537 commit ad12fbd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [20.18.0, 22, 23]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use supported Node.js Version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.18.0
node-version: ${{ matrix.node-version }}
- name: Restore cached dependencies
uses: actions/cache@v3
with:
Expand All @@ -23,6 +28,7 @@ jobs:
- name: Install dependencies
run: pnpm install --shamefully-hoist
- name: Run Tests
if: matrix.os != 'windows-latest' && matrix.node-version != '20.18.0'
run: pnpm run ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist/
types/
coverage/
coverage/
node_modules/
.eslintcache
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"format": "prettier -w src test",
"lint": "eslint --cache",
"typecheck": "tsc -p . --emitDeclarationOnly",
"test": "TS_NODE_PROJECT=tsconfig.test.json c8 -c test/config/c8-local.json node --import @swc-node/register/esm-register --test test/*.test.ts",
"test:ci": "TS_NODE_PROJECT=tsconfig.test.json c8 -c test/config/c8-ci.json node --import @swc-node/register/esm-register --test-reporter=tap --test test/*.test.ts",
"test": "cross-env TS_NODE_PROJECT=tsconfig.test.json c8 -c test/config/c8-local.json node --import @swc-node/register/esm-register --test test/*.test.ts",
"test:ci": "cross-env TS_NODE_PROJECT=tsconfig.test.json c8 -c test/config/c8-ci.json node --import @swc-node/register/esm-register --test-reporter=tap --test test/*.test.ts",
"ci": "npm run build && npm run test:ci",
"prepublishOnly": "npm run ci",
"postpublish": "git push origin && git push origin -f --tags"
Expand All @@ -47,12 +47,13 @@
},
"devDependencies": {
"@cowtech/eslint-config": "10.2.0",
"@swc/cli": "0.5.2",
"@swc/core": "^1.10.3",
"@swc/cli": "^0.6.0",
"@swc/core": "^1.10.7",
"@types/node": "^22.10.2",
"c8": "^10.1.3",
"chokidar": "^4.0.3",
"concurrently": "^9.1.1",
"cross-env": "^7.0.3",
"eslint": "^9.17.0",
"prettier": "^3.4.2",
"proxyquire": "^2.1.3",
Expand Down
8 changes: 4 additions & 4 deletions src/models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type Histogram } from 'hdr-histogram-js'
import { resolve } from 'node:path'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import { type Worker } from 'node:worker_threads'

export interface PrintOptions {
Expand Down Expand Up @@ -100,9 +101,8 @@ export const defaultOptions = {
export const percentiles = [0.001, 0.01, 0.1, 1, 2.5, 10, 25, 50, 75, 90, 97.5, 99, 99.9, 99.99, 99.999]

export const runnerPath = resolve(
import.meta.url
.replace('file://', '')
.replace('/src/', '/dist/')
dirname(fileURLToPath(import.meta.url))
.replace('src', 'dist')
.replace(/models.(js|ts)/, ''),
'./runner.js'
)

0 comments on commit ad12fbd

Please sign in to comment.