vibetunnel/.github/workflows/node.yml
Peter Steinberger 25d5bc5232 Fix CI: Convert reusable workflows to use workflow_call trigger
- Changed swift.yml, rust.yml, and node.yml from direct triggers to workflow_call
- This fixes the workflow configuration error causing immediate CI failures
- Reusable workflows must use workflow_call when invoked by other workflows
2025-06-18 13:00:17 +02:00

113 lines
No EOL
2.5 KiB
YAML

name: Node.js CI
on:
workflow_call:
jobs:
lint:
name: Lint TypeScript/JavaScript Code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: npm ci
- name: Check formatting with Prettier
working-directory: web
run: npm run format:check
- name: Run ESLint
working-directory: web
run: npm run lint
build-and-test:
name: Build and Test
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: npm ci
- name: Build frontend and backend
working-directory: web
run: npm run build
- name: Run tests
working-directory: web
run: npm test -- --passWithNoTests
# Added --passWithNoTests since there are no test files yet
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: node-build-artifacts
path: |
web/dist/
web/public/bundle/
type-check:
name: TypeScript Type Checking
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: npm ci
- name: Check TypeScript types
working-directory: web
run: npx tsc --noEmit
audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Run npm audit
working-directory: web
run: npm audit --audit-level=moderate || true
# || true to not fail the build on vulnerabilities, but still report them