Skip to content

Merge pull request #46 from pranamphd/fix-flatted-vuln #56

Merge pull request #46 from pranamphd/fix-flatted-vuln

Merge pull request #46 from pranamphd/fix-flatted-vuln #56

Workflow file for this run

# CI workflow for digipin-ts TypeScript project
# This workflow lints, typechecks, tests, and audits the codebase on pushes and pull requests to main.
# It also supports manual triggering via workflow_dispatch.
# It runs on multiple Node.js versions to ensure compatibility.
name: CI — digipin-ts
on:
push:
branches: [main]
paths:
- "src/**/*.ts"
- "tests/**/*.ts"
- "package.json"
- "package-lock.json"
- "tsconfig*.json"
- "eslint.config.ts"
pull_request:
branches: [main]
paths:
- "src/**/*.ts"
- "tests/**/*.ts"
- "package.json"
- "package-lock.json"
- "tsconfig*.json"
- "eslint.config.ts"
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Lint, Typecheck, Test, and Audit
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x, 25.x]
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies (locked)
run: |
set -euo pipefail
npm ci
- name: Lint (eslint)
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Run tests with coverage report
run: |
npm run test:coverage
- name: npm audit (production deps only)
run: |
npm audit --omit=dev --audit-level=low
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # 5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # 1.2.1
with:
token: ${{ secrets.CODECOV_TOKEN }}