ci-job-number

Return CI job number to run huge tests only on first job


Keywords
CI, Travis, AppVeyor, Circle, Semaphore, job
License
MIT
Install
npm install ci-job-number@1.2.2

Documentation

CI Job Number

Return CI job number to run huge tests only on first job.

Often we test different Node.js versions on Travis CI. But Node.js version doesn’t affect on many tests. For example, using external API for docs spelling check.

Since Travis CI is a free common resource, we should be responsible. So we can run big tasks only on first Node.js version.

const ciJobNumber = require('ci-job-number')

if (ciJobNumber() === 1) {
  runSpellingCheck()
} else {
  console.warn('To speed up CI spelling check runs only in first job')
}
Sponsored by Evil Martians

CI Support

  • Travis CI
  • AppVeyor
  • CircleCI
  • Semaphore

Who Use It