Skip to content

Add the Node.js CI workflow #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2025
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": "pnpm@10.12.1",
"lint-staged": {
"**/*": [
"pnpm lint",
"pnpm format"
]
},
"packageManager": "pnpm@10.12.1",
"devDependencies": {
"@eslint/js": "^9.31.0",
"@types/chai": "^5.2.2",
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy