Merge pull request #475 from raifdmueller/feat/three-community-anchors #558
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: Run Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Lint & Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: website/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./website | |
| run: npm ci | |
| - name: Run ESLint (website) | |
| working-directory: ./website | |
| run: npm run lint | |
| - name: Check Prettier formatting | |
| working-directory: ./website | |
| run: npm run format:check | |
| - name: Install scripts dependencies | |
| working-directory: ./scripts | |
| run: npm ci | |
| - name: Run ESLint (scripts) | |
| working-directory: ./scripts | |
| run: npm run lint | |
| - name: Check Prettier formatting (scripts) | |
| working-directory: ./scripts | |
| run: npm run format:check | |
| e2e-tests: | |
| name: E2E Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: website/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./website | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| working-directory: ./website | |
| run: npx playwright install --with-deps chromium | |
| - name: Generate llms.txt and all-anchors.adoc | |
| working-directory: ./scripts | |
| run: | | |
| npm ci | |
| node generate-llms-txt.js | |
| - name: Copy anchor files to public directory | |
| run: | | |
| mkdir -p website/public/docs | |
| cp -r docs/anchors website/public/docs/ | |
| - name: Render documentation to HTML | |
| working-directory: ./scripts | |
| run: node render-docs.js | |
| - name: Run E2E tests | |
| working-directory: ./website | |
| run: npm run test:e2e | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: website/playwright-report/ | |
| retention-days: 7 | |
| lighthouse: | |
| name: Lighthouse CI | |
| runs-on: ubuntu-latest | |
| # Only run on main branch after deployment | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: [] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: website/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./website | |
| run: npm ci | |
| - name: Run Lighthouse CI | |
| working-directory: ./website | |
| run: npm run test:lighthouse | |
| env: | |
| LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
| - name: Upload Lighthouse results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lighthouse-report | |
| path: website/.lighthouseci/ | |
| retention-days: 7 | |
| dependency-check: | |
| name: Dependency Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: website/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./website | |
| run: npm ci | |
| - name: Run security audit | |
| working-directory: ./website | |
| run: npm audit --audit-level=high |