tractatus/.github/workflows/ci.yml
TheFlow 25b9c6c85b feat: complete GitHub community infrastructure
- Update issue templates (bug report, feature request, documentation, research question)
- Add PR template with values alignment checklist
- Add CI workflow with tests and CSP compliance checks
- Configure issue template defaults

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 23:11:45 +13:00

87 lines
1.8 KiB
YAML

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
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 unit tests
run: npm run test:unit
env:
NODE_ENV: test
- name: Run integration tests
run: npm run test:integration
env:
NODE_ENV: test
lint:
name: Lint 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.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
continue-on-error: true
csp-check:
name: CSP Compliance Check
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.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check HTML files for CSP violations
run: |
echo "Checking for inline event handlers..."
! grep -r "onclick=" public/*.html
! grep -r "onchange=" public/*.html
! grep -r "onload=" public/*.html
echo "Checking for inline scripts..."
! grep -r "<script>" public/*.html | grep -v "src="
echo "✅ All HTML files are CSP compliant"