Skip to content

fix: migrate to ESLint flat config format #18

fix: migrate to ESLint flat config format

fix: migrate to ESLint flat config format #18

Workflow file for this run

name: Test Suite
on:
push:
branches: [ main, develop, 'claude/**' ]
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Validate extension
run: npm run validate
- name: Run unit tests
run: npm run test:unit
- name: Run integration tests
run: npm run test:integration
- name: Generate coverage report
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Archive test results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results-${{ matrix.node-version }}
path: |
coverage/
html/
retention-days: 30
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Validate ESLint config exists
run: |
if [ ! -f "eslint.config.js" ]; then
echo "ERROR: eslint.config.js not found"
echo "See docs/adr/ADR-001-eslint-config-format.md for rationale"
exit 1
fi
# Fail if legacy config exists (should have been deleted)
if [ -f ".eslintrc.json" ] || [ -f ".eslintrc.js" ] || [ -f ".eslintrc.yaml" ]; then
echo "ERROR: Legacy ESLint config found - delete it"
exit 1
fi
- name: Validate ESLint config loads
run: npx eslint --print-config background.js > /dev/null
- name: Run ESLint
run: npm run lint
- name: Run ESLint config tests
run: npm run test -- tests/config/eslint-config.test.js
- name: Check for security vulnerabilities
run: npm audit --audit-level=moderate
build:
name: Build Extension
runs-on: ubuntu-latest
needs: [test, code-quality]
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Validate manifest
run: node scripts/validate-extension.js
- name: Archive extension
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: hera-extension
path: |
manifest.json
background.js
content-script.js
popup.js
evidence-collector.js
modules/
lib/
icons/
devtools/
popup.html
devtools.html
retention-days: 30