Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdds a caching example for CircleCI #364
Conversation
96c9b6c
to
7e164d2
| steps: | ||
| - run: | ||
| command: | | ||
| cat .pre-commit-config.yaml > pre-commit-deps.txt |
asottile
Jun 26, 2020
Member
UUOC: cp does this better
but why make a separate file, can't you just use the original file?
also looks like pre-commit-deps.txt is unused
remeika
Jun 26, 2020
•
Author
Contributor
This was a copy-pasta error. Creating a new file, pre-commit-cache-key.txt, to concatenate .pre-commit-config.yaml & python -VV, since CircleCI can't use environment variables in cache key templates.
| @@ -1572,6 +1572,10 @@ which may be faster, use something like | |||
| [XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html | |||
| If your CI environment uses immutable caches, the pre-commit repository should | |||
| be versioned using both the contents of your configuration file (typically | |||
| `.pre-commit-config.yaml`) and the output of the command `python -VV`. | |||
asottile
Jun 26, 2020
Member
this isn't always completely true, but is a good estimate for the healthy() check
| ```yaml | ||
| steps: | ||
| - run: | ||
| command: | |
asottile
Jun 26, 2020
Member
this indentation doesn't line up properly (either use 2 or 4 space indents, but not mixed)
c6e4b73
to
9424660
|
I ended up just removing the immutable part that was added -- I didn't like the wording "gory details" and the advice was too python-specific (and there are cases where even that is insufficient). I also added the (missing) thanks again for the patch! |

Updates docs about managing CI caches to include general guidance on how to version the cache, and a specific example of how to do this in CircleCI.