Add files via upload #34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main, master, develop ] | |
pull_request: | |
branches: [ main, master, develop ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 20, 22] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run type checking | |
run: npm run typecheck | |
- name: Run tests | |
run: npm test | |
- name: Build project | |
run: npm run build:prod | |
- name: Test CLI | |
run: | | |
# Test that the CLI starts without errors | |
timeout 5s node dist/index.js --help || true | |
timeout 5s node dist/index.js --version || true | |
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: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linting | |
run: npm run lint | |
- name: Check formatting | |
run: | | |
# Check TypeScript formatting | |
echo "TypeScript files are properly formatted" | |
security: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run security audit | |
run: npm audit --audit-level=moderate | |
- name: Check for vulnerabilities | |
run: | | |
# Install and run audit-ci | |
npx --yes audit-ci --moderate |