https://github.com/odlp/skippable
Skip a command unless file(s) changed
https://github.com/odlp/skippable
Last synced: about 1 year ago
JSON representation
Skip a command unless file(s) changed
- Host: GitHub
- URL: https://github.com/odlp/skippable
- Owner: odlp
- License: mit
- Created: 2020-12-22T16:10:53.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-23T15:28:12.000Z (over 5 years ago)
- Last Synced: 2024-04-16T21:04:58.824Z (about 2 years ago)
- Language: Ruby
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this 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](https://github.com/pivotal/LicenseFinder) 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:
```ruby
group :development do
gem "skippable", require: false
end
```
Setup a `.skippable.yml` config file with one or more tasks:
```yaml
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
```yaml
# .skippable.yml
tasks:
license_finder:
command: bundle exec license_finder
paths:
- Gemfile.lock
- yarn.lock
```
Invocation:
```
bundle exec skippable license_finder
```