# How to skip jobs based on the files changed in a subdirectory?

**URL:** <https://travis-ci.community/t/how-to-skip-jobs-based-on-the-files-changed-in-a-subdirectory/2979>\
**Category:** Feature Requests\
**Created:** [April 10, 2019, 8:23pm UTC](https://travis-ci.community/t/how-to-skip-jobs-based-on-the-files-changed-in-a-subdirectory/2979 "2019-04-10T20:23:06Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [March 5, 2020, 12:03am UTC](https://travis-ci.community/t/how-to-skip-jobs-based-on-the-files-changed-in-a-subdirectory/2979/15 "2020-03-05T00:03:43Z")

</div>

I’ve read up on monorepos, and it looks like Travis is not really equipped to support monorepos out of the box.

- In monorepos, the amount of rebuilding necessary is determined dynamically by intelligent build tools, and the logic is completely tool-specific.
  - So the proposed feature is not an adequate solution. It _may_ be good enough specifically for the OP in the specific situation, but I foresee requests for all sorts of additional logic flooding in quickly if this is implemented.

An adequate solution would either be

- provide beefier build machines with more cores (to commercial users on demand) that can run many tasks in parallel and build everything within a single job; or
- introduce a “planning” stage that would be able to edit `.travis.yml` (or, more probably, its representation) on the fly, e.g. disabling jobs as necessary; or
- in conjunction with the [flowchart build model](https://travis-ci.community/t/upgrade-build-stages-list-to-a-flowchart-to-get-a-pipelines-feature/5348), ability to edit config of the jobs down the flowchart edges from the current job
  - to avoid conflicts, there should probably be a phase for this only during which the configs are accessible and are protected with a critical section synchronization primitive

A workaround would be to

- Have a series of stages with the same configuration which would
  - determine what to build according to the specific tool’s logic
  - build what is possible within the time limit
  - pass information to the next stage so that it can do the same, picking off from where this job stopped
  - of course, you can run several such jobs in parallel, too, but it’s going to be tricky due to inability to pass information between sibling jobs

---

_[View the full topic](https://travis-ci.community/t/how-to-skip-jobs-based-on-the-files-changed-in-a-subdirectory/2979)._
