CICD-070 · Run Node tests and build assets
Encyclopedia · Language build toolchains · All snippets
Previous · CICD-069 · Next · CICD-071
1. Where it fits
- Placement Bash run step following checkout, or equivalent lab terminal.
- Prerequisites source repository with committed build manifest and pinned matching toolchain.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
npm ci
npm test -- --ci
npm run build3. How it works
A clean install is based on the committed package lock and package manifest. An inconsistent pair is rejected. The shell predicate makes the expected state explicit and returns a nonzero status when it is not satisfied.
4. Verify the result
Use a test runner that supports --ci and a package.json build script.
Validation syntax-validated (Bash parse). Status definitions.