10-minutes setup guide for building a NodeJS repo including Coveralls test stats. No need for Travis any more.
Table of Contents
Importance of CI for small NodeJS projects
CI/CD nowadays is an integral part of every medium to large-scaled software project to be successful. For small and very small projects, e.g. your private ones with you as the only developer, you may ask yourself if it does make sense to setup a CI process and bear all the efforts for that.
I was also wondering a long time about that question, but the clear answer to that is YES. Because:
Used Travis-CI for free so far? Use this guide to migrate.
Starting some time ago using CI for small NodeJS projects, Travis-CI was a perfect platform for doing that at no cost. Unfortunately, Travis-CI decided in late 2020 to change the product and pricing model… in a very bad way for a single non-commercial developer having only a couple of repositories.
So read on to get to know how to easily use GitHub actions instead… 😉
Setting up a minimal NodeJS CI workflow with GitHub actions
To use a GitHub action for building your repository at each push (on all branches), all you have to do is to place a YAML file under
.github/workflows and commit it with your repo.
That’s it! Commit & push the workflow definition and head over to the Actions section of your repo where you can see all executed workflows…
…and detailed results for every step by clicking on the workflow…
Easy, right? With the workflow definition above the following job will be executed on each push in every branch of the project:
For further information e.g. on how to build on multiple versions of NodeJS there`s a very detailed documentation on GitHub.
Some sidenotes about CI with GitHub actions:
Commercial review of the solution
Setting up a CI build with GitHub actions is very easy – now what about the costs? Good news on that…
That’s fair. In comparison Travis CI was also free for public repos in the past but there wasn’t any free contingent for any private repo. Building even only one private repo you would have starting paying at Travis…
And even if the 2,000 minutes/month are not enough for you the GitHub plans seem very affordable compared to other CI service providers.
The next stage would cost you only 4$/month if you are a single developer. Pretty ok, right.
To easily keep track of your consumed actions minutes simply head to Billing&plans under your setting at GitHub. There you can also set up a spending limit if you’ve already provided a payment method.