34 lines
614 B
YAML
34 lines
614 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
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'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: npm test --if-present || echo "No test script"
|
|
|
|
- name: Check TypeScript compilation
|
|
run: |
|
|
if [ -f "tsconfig.json" ]; then
|
|
npx tsc --noEmit || echo "TypeScript check failed"
|
|
fi
|