vibetunnel/.github/workflows/node.yml
Peter Steinberger 6a8f472832 feat: adopt Blacksmith CI runners and comprehensive updates
- Migrate GitHub Actions to Blacksmith runners for faster CI
  - Update ubuntu-latest to blacksmith-4vcpu-ubuntu-2404
  - Update actions/setup-node@v4 to useblacksmith/setup-node@v5
  - Update Swatinem/rust-cache@v2 to useblacksmith/rust-cache@v3

- Fix all linting warnings across all platforms
  - TypeScript: Fix any type warnings with proper type annotations
  - Rust: All clippy warnings resolved
  - Swift: Fix SwiftLint violations and format code

- Update all dependencies to latest versions
  - npm: Major updates including Express 5 compatibility fixes
  - Rust: Update 7 crates to latest compatible versions
  - Swift: Dependencies already up-to-date

- Add comprehensive test suite using Vitest
  - API endpoint tests for session CRUD operations
  - WebSocket connection and streaming tests
  - Session management lifecycle tests
  - Frontend component tests (terminal, session-list)
  - Critical functionality tests covering core features
  - Test infrastructure with proper mocking and utilities

- All tests passing, ready for production use
2025-06-18 19:10:03 +02:00

113 lines
No EOL
2.6 KiB
YAML

name: Node.js CI
on:
workflow_call:
jobs:
lint:
name: Lint TypeScript/JavaScript Code
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: useblacksmith/setup-node@v5
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: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: useblacksmith/setup-node@v5
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: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: useblacksmith/setup-node@v5
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: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: useblacksmith/setup-node@v5
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