Add legacy-peer-deps via .npmrc for npm ci on Actions and run Validate on PRs only; main pushes use deploy workflow_call. Co-authored-by: Cursor <cursoragent@cursor.com>
67 lines
1.3 KiB
YAML
67 lines
1.3 KiB
YAML
name: Validate
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_call:
|
|
|
|
concurrency:
|
|
group: validate-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test-and-a11y:
|
|
name: Tests + header WCAG audit
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Type check
|
|
run: npm run type-check
|
|
|
|
- name: Run unit tests
|
|
run: npm run test:ci
|
|
|
|
- name: Header WCAG contrast audit (token pairs)
|
|
run: npm run a11y:header-audit
|
|
|
|
build:
|
|
name: Production build
|
|
runs-on: ubuntu-latest
|
|
needs: test-and-a11y
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: npm
|
|
|
|
- name: Install ImageMagick (brand asset prebuild)
|
|
run: sudo apt-get update && sudo apt-get install -y imagemagick
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Upload dist artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist/
|
|
if-no-files-found: error
|