Skip to content

ci: GitHub Actions workflow + smoke tests #1

ci: GitHub Actions workflow + smoke tests

ci: GitHub Actions workflow + smoke tests #1

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
unit-tests:
name: Unit Tests + Smoke Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Validate JS syntax
run: |
echo "Checking all JavaScript files parse correctly..."
find src test -name '*.js' -exec node --check {} \;
echo "✅ All files parse correctly"
- name: Validate ecosystem config
run: |
node -e "
const config = require('./ecosystem.config.js');
assert(config.apps && config.apps.length > 0, 'No apps defined');
assert(config.apps.every(a => a.name && a.script), 'Each app needs name and script');
console.log('✅ Valid PM2 config with', config.apps.length, 'apps');
"
- name: Run unit tests
run: node test/compressor-test.js
- name: Run smoke tests
env:
OPENAI_API_KEY: sk-test-dummy-key-for-ci
SCAN_ROOT: /tmp
run: node test/smoke-test.js
integration-tests:
name: Integration Tests (optional)
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Start agents
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SCAN_ROOT: /tmp
run: |
mkdir -p logs .checkpoints .control
npx pm2 start ecosystem.config.js
sleep 10
npx pm2 status
- name: Run uptime test
run: node test/uptime-test.js
- name: Run recovery test
run: node test/recovery-test.js
- name: Run chaos test
run: node test/chaos-test.js
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: test-report-*.json
- name: Cleanup
if: always()
run: npx pm2 delete ecosystem.config.js || true