Files
ci-templates/.gitea/workflows/lint-node.yaml
Platform Engineer a620868998 feat: add reusable CI/CD pipeline templates
Reusable Gitea Actions workflows for lint, test, build, and deploy:
- lint-python, lint-node, lint-rust
- test-python, test-node, test-rust
- build-push (Docker build + push to Gitea registry)
- deploy-k8s (GitOps image tag update in cluster repo)

Plus example caller workflows for python-fullstack, rust-service,
and node-frontend stacks. Branch refs aligned to staging per CON-570 standards.
2026-03-31 19:55:17 +03:00

55 lines
1.7 KiB
YAML

# Reusable workflow: Node.js/TypeScript linting with ESLint + type-check
# Usage: uses: wectrl-net/ci-templates/.gitea/workflows/lint-node.yaml@main
name: Lint Node (ESLint + tsc)
on:
workflow_call:
inputs:
node-version:
description: "Node.js version to use"
required: false
type: string
default: "22"
working-directory:
description: "Directory containing the Node.js project (with package.json)"
required: false
type: string
default: "."
package-manager:
description: "Package manager (npm or pnpm)"
required: false
type: string
default: "npm"
lint-script:
description: "npm script name for linting"
required: false
type: string
default: "lint"
typecheck-script:
description: "npm script name for type-checking (leave empty to skip)"
required: false
type: string
default: "typecheck"
jobs:
lint:
name: ESLint + TypeScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.package-manager }}
cache-dependency-path: ${{ inputs.working-directory }}/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: ${{ inputs.working-directory }}
- name: ESLint
run: npm run ${{ inputs.lint-script }}
working-directory: ${{ inputs.working-directory }}
- name: TypeScript type-check
if: inputs.typecheck-script != ''
run: npm run ${{ inputs.typecheck-script }}
working-directory: ${{ inputs.working-directory }}