Skip to content

React CI Standard

nexa-web uses Vitest, not Jest. Component tests use @testing-library/react, @testing-library/user-event, and jsdom where a browser-like DOM is required.

Biome 2.5.3 is the only approved formatter and linter. The shared workflow runs @biomejs/biome@2.5.3 check .; repositories do not add Prettier or ESLint checks.

  1. npm ci using the committed lock file.
  2. biome format ..
  3. biome lint . with the approved warnings policy.
  4. tsc --noEmit or the repository’s equivalent strict type check.
  5. Vitest unit/component tests.
  6. Vitest coverage in LCOV for SonarQube and human review.
  7. SonarQube analysis.
  8. Semgrep, Gitleaks, and Trivy filesystem/config scan.
  9. Multi-stage Docker build and final runtime-image scan.
  10. Syft SBOM, Cosign signing where required, and multi-registry publication.

Tests exercise user-observable behavior rather than component implementation details. Testing Library queries prefer roles, labels, and accessible names. user-event is preferred for interactions that should resemble browser behavior. API clients and shared contracts remain typed. Production builds fail on unresolved TypeScript errors.

No frontend secret is embedded through build-time environment variables. Browser configuration is considered publicly inspectable.

  • Source CI gate: Vitest unit/component tests and SonarQube coverage.
  • Current browser flows: custom .mjs browser/E2E flows where already implemented.
  • Post-deployment target standard: Playwright with Allure reporting against deployed Dev/Test environments.
  • API/contract suites: run against deployed services and remain outside the source-image merge gate.
jobs:
ci:
uses: dataready-ai/nexa-ci/.github/workflows/react-ci.yml@v1
with:
node-version: '24'
test-command: npm run test:unit
coverage-command: npm run test:coverage
image-name: nexa-web
dockerfile: Dockerfile
docker-context: .
ecr-repository: aws-iac-nexa-web
acr-repository: nexa-web
spcs-repository: NEXA_WEB_REPO
sonar-project-key: nexa-web
secrets: inherit