Skip to content

Merge pull request #19 from Lullabot/fix-agents-test #25

Merge pull request #19 from Lullabot/fix-agents-test

Merge pull request #19 from Lullabot/fix-agents-test #25

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Test on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Run tests with coverage
run: npm run test:coverage
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
file: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
lint:
name: Lint and Format 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: Run ESLint
run: npm run lint
- name: Check Prettier formatting
run: npm run format:check
- name: Check for auto-fixable ESLint issues
run: |
npm run lint:fix
if [ -n "$(git status --porcelain)" ]; then
echo "❌ ESLint found auto-fixable issues. Please run 'npm run lint:fix' locally."
git diff
exit 1
else
echo "✅ No auto-fixable ESLint issues found."
fi
build:
name: Build 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: Verify package.json
run: |
echo "✅ Package name: $(npm pkg get name)"
echo "✅ Package version: $(npm pkg get version)"
echo "✅ Package description: $(npm pkg get description)"
echo "✅ Main entry point: $(npm pkg get main)"
echo "✅ Binary command: $(npm pkg get bin)"
- name: Test CLI help command
run: npm start -- --help
- name: Test CLI version command
run: npm start -- --version