Skip to content

Add Coursier to Travis cache #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ commands:
- save_cache:
key: sbt-deps-v1-{{ checksum "build.sbt" }}
paths:
- "~/.coursier"
- "~/.ivy2/cache"
- "~/.sbt"
- "~/.m2"
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ script:
before_cache:
- find $HOME/.sbt -name "*.lock" | xargs rm
- find $HOME/.ivy2/cache -name "ivydata-*.properties" | xargs rm
- find $HOME/.coursier -name "*.lock" | xargs rm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably search in .cache/coursier too?

cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt
- $HOME/.sdkman
- $HOME/.coursier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- $HOME/.coursier
- $HOME/.cache/coursier

https://get-coursier.io/docs/cache says:

  • on Linux, ~/.cache/coursier/v1. This also applies to Linux-based CI environments, and FreeBSD too.

...
The default location above was set up in coursier 1.0.0-RC12-1 (released on 2017/10/31). The default cache path of former versions was ~/.coursier/cache/v1, both on Linux and OS X.

In order not to re-download all artifacts again, the first version of coursier run on a system, either former or newer, sets the location for newer versions.

In other words, the location of the Coursier cache changes depending on if you've ever ran older coursier or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gah

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depending on if you've ever ran older coursier or not.

How does Coursier determine that?

Travis doesn't cache ~/.coursier or ~/.cache/coursier until the user says so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess coursier will use .coursier if it exists, and .cache/coursier otherwise. In the case of travis, both don't exist we didn't cache so far, so it's using the .cache/coursier. I checked that with my https://github.com/lrytz/travis-test repo.