Skip to content

Instantly share code, notes, and snippets.

@cotsog
Created September 24, 2019 20:31
Show Gist options
  • Save cotsog/be1ea1980af3fc578220cd565db47471 to your computer and use it in GitHub Desktop.
Save cotsog/be1ea1980af3fc578220cd565db47471 to your computer and use it in GitHub Desktop.
Cache APT packages
# .travis.yml
# inspired by https://stackoverflow.com/a/52446551
sudo: required
dist: trusty
language: scala
scala: 2.12.8
before_cache:
- sudo chown -R $USER ${TRAVIS_BUILD_DIR}/apt-cache
cache:
directories:
- $TRAVIS_BUILD_DIR/.ivy2 # to avoid always download the same stuff from maven central
- apt-cache
before_install:
- |
if [ ! -f ${TRAVIS_BUILD_DIR}/apt-cache/pkgcache.bin ]; then
mkdir -p ${TRAVIS_BUILD_DIR}/apt-cache/archives/partial
mkdir -p ${TRAVIS_BUILD_DIR}/apt-cache/partial
mkdir -p ${TRAVIS_BUILD_DIR}/apt-cache/lists
sudo apt-get -y -o Dir::cache=${TRAVIS_BUILD_DIR}/apt-cache -o Dir::State::Lists=${TRAVIS_BUILD_DIR}/apt-cache/lists update
sudo apt-get install --download-only -o Dir::cache=${TRAVIS_BUILD_DIR}/apt-cache -o Dir::State::Lists=${TRAVIS_BUILD_DIR}/apt-cache/lists texlive-full texlive-latex-extra texlive-lang-all texlive-lang-swedish
fi
- sudo apt-get install --no-download -o Dir::cache=${TRAVIS_BUILD_DIR}/apt-cache -o Dir::State::Lists=${TRAVIS_BUILD_DIR}/apt-cache/lists texlive-full texlive-latex-extra texlive-lang-all texlive-lang-swedish
script:
- sbt build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment