Fix test suite teardown and gate CI on tests plus header WCAG audit.

Repair Navigation and HeroSection assertions, stop deleting window.location in jsdom setup, and add validate/a11y-live GitHub workflows with type-check and test:ci scripts.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
defiQUG
2026-06-15 19:29:33 -07:00
co-authored by Cursor
parent 5c465d176e
commit d00ab4cbaf
8 changed files with 177 additions and 107 deletions
+38 -77
View File
@@ -2,86 +2,47 @@ name: Build and Deploy
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run type checking
run: npm run type-check
- name: Run linting
run: npm run lint
- name: Run tests
run: npm run test:ci
- name: Security audit
run: npm audit --audit-level moderate
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
env:
VITE_APP_VERSION: ${{ github.sha }}
VITE_BUILD_TIME: ${{ github.event.head_commit.timestamp }}
- name: Analyze bundle size
run: npx bundlesize
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
validate:
uses: ./.github/workflows/validate.yml
deploy:
needs: build
needs: validate
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
permissions:
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
cname: miraclesinmotion.org
- 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 application
run: npm run build
env:
VITE_APP_VERSION: ${{ github.sha }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
cname: mim4u.org