Now your task is to run all the unit tests when the PR is created to the main
branch. To save the costs when the PR is created to other branches jobs should not be run.
The unit tests are located in the desktop-app
folder. To run them you need to install the dependencies and then run the tests.
Since the tests were not run regularly they may be broken. Fix them to be able to merge your branch.
- Unit tests are run when new commit is pushed to the branch with PR to main
- Unit tests are NOT run when new commit is pushed to the branch that does not have PR to main
- When unit tests are not passing, the job should fail
- Unit tests are run on latest LTS version of node
- Node dependencies are cached
- Tests for the
desktop-app
are fixed and are passing
Pipeline with failing unit tests:
There should be no pipeline for PRs to branches different then main
Those hints will help you start
- npm install
- npm test
- actions/setup-node@v3
- setting working directory
- setting setting for all jobs
- Example of Node.js workflow