- Dedicated 'Run unit tests' step (npm run test:unit) so unit tests are visible and guaranteed in CI rather than implied by the build script. - Build now calls react-scripts build directly, avoiding a redundant second Jest run (CI=true still fails the build on lint warnings). - Bump Node 18 (EOL) -> 20 and enable npm dependency caching. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
502 B
YAML
25 lines
502 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run unit tests
|
|
run: npm run test:unit
|
|
- name: Build production bundle
|
|
run: npx react-scripts build
|