Project

skippable

0.0
No commit activity in last 3 years
No release in over 3 years
Skip a command unless file(s) changed
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Skippable

Skippable helps you skip slow commands unless certain files changed. This can be handy on CI, where valuable time, money, and CO₂ are often wasted by repeatedly running the same command when nothing changed.

For example License Finder takes ~45 seconds to run on a project with Ruby gems and NPM dependencies. In this example there's no need to check the licenses if the dependency lockfiles didn't change.

Usage

Add Skippable to your Gemfile:

group :development do
  gem "skippable", require: false
end

Setup a .skippable.yml config file with one or more tasks:

tasks:
  expensive_op:
    command: bundle exec my_slow_command
    paths:
      - lockfile_a
      - lockfile_b

Run the task using skippable:

bundle exec skippable expensive_op
  • If the cache was cold OR the lockfiles changed, the specified command will be run
  • If the cache is warm, and the lockfiles haven't changed, the command will be skipped

Finally, cache the following directory to persist state across builds:

tmp/skippable

Example

# .skippable.yml
tasks:
  license_finder:
    command: bundle exec license_finder
    paths:
      - Gemfile.lock
      - yarn.lock

Invocation:

bundle exec skippable license_finder