Expand E2E tests from 9 to 53 with resilient selectors #11
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 / Deploy | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run lint:md | |
| - run: npm run typecheck | |
| link-check: | |
| runs-on: ubuntu-latest | |
| # Skip via commit message: include '[skip link check]' in the commit message. | |
| # Skip via repo variable: set SKIP_LINK_CHECK=true in Settings → Variables. | |
| if: | | |
| !contains(github.event.head_commit.message, '[skip link check]') && | |
| vars.SKIP_LINK_CHECK != 'true' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: lycheeverse/lychee-action@v2 | |
| with: | |
| # Check all markdown source files for broken links. | |
| # Excludes localhost (used in docs examples) and fragments-only anchors. | |
| args: > | |
| --verbose | |
| --no-progress | |
| --base-url 'https://mellea.ai' | |
| --exclude 'localhost' | |
| --exclude 'mellea\.ai' | |
| --exclude '^#' | |
| content/blogs/**/*.md *.md | |
| fail: true | |
| test-unit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - run: npm ci | |
| - run: npm run test:unit | |
| build: | |
| needs: [lint] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - uses: actions/cache@v5 | |
| with: | |
| path: .next/cache | |
| key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
| - run: npm ci | |
| - run: npm run build | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: website | |
| path: ./out | |
| - uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./out | |
| test-e2e: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - run: npm ci | |
| - run: npx playwright install --with-deps chromium | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: website | |
| path: ./out | |
| - run: npm run test:e2e | |
| - uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 7 | |
| deploy: | |
| needs: [test-unit, test-e2e, link-check] | |
| # Allow deploy when link-check was skipped via the override mechanisms above. | |
| if: | | |
| github.ref == 'refs/heads/main' && | |
| (needs.link-check.result == 'success' || needs.link-check.result == 'skipped') | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/deploy-pages@v5 | |
| id: deployment |