ci / build-and-test (push) Canceled after 0s
Pin eslint@9 (jsx-a11y peer) and add eslint-plugin-astro + eslint-plugin-jsx-a11y + typescript-eslint as devDeps. eslint.config.js wires: - @eslint/js recommended and typescript-eslint recommended for general .ts/.mjs. - astro flat/jsx-a11y-recommended for .astro files, registering the jsx-a11y plugin explicitly. - project-specific tweaks: drop jsx-a11y/anchor-is-valid (noisy on Astro links), warn on click-events-have-key-events and no-static-element-interactions, allow any in scripts/tests, ignore env.d.ts triple-slash ref (Astro convention). Scripts: lint and lint:fix. prebuild now also runs lint, so the same chain guards a11y regressions as type and build errors. CI workflow gains a lint step between check and build. 0 errors, 16/16 e2e still pass.
69 lines
1.5 KiB
YAML
69 lines
1.5 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.local/share/pnpm/store
|
|
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
pnpm-${{ runner.os }}-
|
|
|
|
- name: Enable corepack
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Install Playwright browser
|
|
run: pnpm exec playwright install --with-deps chromium
|
|
|
|
- name: Typecheck (astro check)
|
|
run: pnpm run check
|
|
|
|
- name: Lint
|
|
run: pnpm run lint
|
|
|
|
- name: Build
|
|
run: pnpm run build
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
if-no-files-found: error
|
|
retention-days: 7
|
|
|
|
- name: End-to-end tests (Playwright + axe)
|
|
run: pnpm run test:e2e
|
|
|
|
- name: Upload Playwright report
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report
|
|
retention-days: 7
|