DEV Community

Cover image for Improving your CI pipeline for Node.js

Improving your CI pipeline for Node.js

Paula Santamaría on September 10, 2019

I've been wanting to experiment with CI pipelines for a long time and this weekend I was finally able to spend some time on it. I setup one on Azur...
Collapse
 
evanplaice profile image
Evan Plaice • Edited

Awesome article!

It's hard to find good sorces on how to set up Actions CI (i just learned how last week), especially w/ the YML-based syntax.

Minor Nits:

Use 'npm ci' instead of 'npm install'. Ci installs the fixed versions of dependencies from package-lock.json. This should prevent 'works on my machine' config differences.

Also, pretty sure you don't have to reference node_modules/bin for dependency scripts. The dependency name alone in a NPM script should work.

If you need to run a dependency from the CLI, nox makes this easier. Ex 'npx eslint --init'

Collapse
 
paulasantamaria profile image
Paula Santamaría

Didn't know about npm ci, great tip! About
./node_modules/.bin/eslint, I found it odd too, but I copied it from the eslint docs 🤷.

Thank you Evan!

Collapse
 
therealkevinard profile image
Kevin Ard

Not a point-by-point "this is what you're wrong about" 😅, but I found this gem this morning. The Gitter.im source repo.

I know enough Gitlab CI and Make to read my way through it and... Wow. This blows me away ♥️

gitlab.com/gitlab-org/gitter/webapp

Collapse
 
parasbansalrs profile image
Paras Bansal

Amazing article. It solved a lot of my issues.

One thing, instead of jest-unit the module is jest-junit may be.

This might help someone.

Collapse
 
sampathkumar27896 profile image
KeyboardScript

Is there a better way to view the ESlint results in the form of reports something similar like Jest test report?.