Merge pull request #148 from jgoldfoot/dependabot/github_actions/acti… #393
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, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| test: | |
| name: Test on Node.js ${{ matrix.node-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x, 22.x] | |
| env: | |
| PUPPETEER_SKIP_DOWNLOAD: 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: npm install --include=optional | |
| - name: Run tests | |
| run: npm test | |
| - name: Generate coverage report | |
| if: matrix.node-version == '20.x' | |
| run: npm run test:coverage | |
| - name: Upload coverage to Codecov | |
| if: matrix.node-version == '20.x' | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: codecov-bimodal-design | |
| fail_ci_if_error: false | |
| lint: | |
| name: Lint Code | |
| runs-on: ubuntu-latest | |
| env: | |
| PUPPETEER_SKIP_DOWNLOAD: 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '20.x' | |
| - name: Install dependencies | |
| run: npm install --include=optional | |
| - name: Run ESLint | |
| run: npm run lint | |
| - name: Check code formatting | |
| run: npm run format:check | |
| validate-examples: | |
| name: Validate Examples | |
| runs-on: ubuntu-latest | |
| env: | |
| PUPPETEER_SKIP_DOWNLOAD: 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '20.x' | |
| - name: Install dependencies | |
| run: npm install --include=optional | |
| - name: Validate SSR example | |
| run: | | |
| echo "Testing SSR example should pass FR-1" | |
| node tools/validators/fr1-validator.js file://$(pwd)/examples/ssr-pass-example.html || true | |
| - name: Validate CSR example | |
| run: | | |
| echo "Testing CSR example should fail FR-1" | |
| node tools/validators/fr1-validator.js file://$(pwd)/examples/csr-fail-example.html || true | |
| security: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| env: | |
| PUPPETEER_SKIP_DOWNLOAD: 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '20.x' | |
| - name: Install dependencies | |
| run: npm install --include=optional | |
| - name: Run npm audit | |
| run: npm audit --audit-level=moderate | |
| continue-on-error: true | |
| - name: Check for known vulnerabilities | |
| run: | | |
| npm audit --json > audit.json || true | |
| cat audit.json | |
| docs: | |
| name: Validate Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Check for broken links | |
| uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
| with: | |
| use-quiet-mode: 'yes' | |
| config-file: '.github/markdown-link-check-config.json' | |
| continue-on-error: true | |
| - name: Validate required files | |
| run: | | |
| required_files=( | |
| "README.md" | |
| "CONTRIBUTING.md" | |
| "CODE_OF_CONDUCT.md" | |
| "LICENSE" | |
| "SECURITY.md" | |
| "CHANGELOG.md" | |
| "package.json" | |
| ) | |
| for file in "${required_files[@]}"; do | |
| if [ ! -f "$file" ]; then | |
| echo "❌ Missing required file: $file" | |
| exit 1 | |
| else | |
| echo "✅ Found: $file" | |
| fi | |
| done |