This is a demo project showcasing Continuous Integration (CI) with GitHub Actions.
This project includes:
- A simple
add(a, b)function located insrc/add.js - A unit test using Jest in
__tests__/add.test.js - A GitHub Actions workflow in
.github/workflows/ci.ymlto automatically lint and test code on every push or pull request
To enhance the CI pipeline and make the build pass, the following updates were made:
- Bug Fix: Corrected the
addfunction to properly return the sum of two numbers. - Branch Coverage: Updated the workflow to trigger on all branches, not just
main. - Node Version Upgrade: Changed Node.js version from
20to22in the workflow. - Dependency Caching: Added caching for
node_modulesusingactions/cache@v4to speed up builds.
npm install