Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x, 24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: pnpm/action-setup@0609f0983b7a228f052f81ef4c3d6510cae254ad
with:
version: 6.10.0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- run: pnpm ci:lint
- run: pnpm ci:format
- run: pnpm ci:coverage
- run: pnpm test
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
"type": "module",
"scripts": {
"clean": "rm -rf .nyc_output coverage dist",
"test": "nyc mocha 'src/**/*.test.ts' --require=tsx",
"test": "nyc --reporter html --reporter text mocha 'src/**/*.test.ts' --require=tsx",
"lint": "eslint --fix 'src/**/*.ts'",
"format": "prettier --write --ignore-unknown .",
"coverage": "nyc report --reporter html && open coverage/index.html",
"coverage:check": "nyc check-coverage --lines 90 --branches 80 --statements 90",
"prepare": "husky"
"coverage": "open coverage/index.html",
"prepare": "husky",
"ci:lint": "eslint 'src/**/*.ts'",
"ci:format": "prettier --check --ignore-unknown .",
"ci:coverage": "nyc check-coverage --lines 90 --branches 80 --statements 90"
},
"engines": {
"node": ">=22"
},
"packageManager": "[email protected]",
"lint-staged": {
"**/*": [
"pnpm lint",
"pnpm format"
]
},
"packageManager": "[email protected]",
"devDependencies": {
"@eslint/js": "^9.31.0",
"@types/chai": "^5.2.2",
Expand Down