Skip to content

Commit a1041d3

Browse files
committed
travis: Cache directories for build
1 parent a253704 commit a1041d3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.travis.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ matrix:
2828
- env: TMUX_VERSION=master
2929
cache:
3030
- pip
31+
- directories:
32+
- ~/source
33+
- ~/build
3134
before_install:
3235
- export PIP_USE_MIRRORS=true
3336
- pip install --upgrade pytest # https://github.com/travis-ci/travis-ci/issues/4873
@@ -37,13 +40,15 @@ install:
3740
- pip install -e .
3841
- pip install -r requirements/test.txt
3942
before_script:
40-
- git clone https://github.com/tmux/tmux.git tmux
41-
- cd tmux
43+
- mkdir -p ~/source
44+
- mkdir -p ~/build/tmux-$TMUX_VERSION
45+
- if [[ ! -d ~/source/tmux-$TMUX_VERSION ]]; then git clone https://github.com/tmux/tmux.git ~/source/tmux-$TMUX_VERSION; fi
46+
- cd ~/source/tmux-$TMUX_VERSION
4247
- git checkout $TMUX_VERSION
43-
- sh autogen.sh
44-
- ./configure --prefix=$HOME/tmux && make && make install
45-
- export PATH=$HOME/tmux/bin:$PATH
46-
- cd ..
48+
- export PATH=$HOME/build/tmux-$TMUX_VERSION/bin:$PATH
49+
- if [[ $TMUX_VERSION == "master" || ! $(tmux -V | grep $TMUX_VERSION) ]]; then sh autogen.sh; fi
50+
- if [[ $TMUX_VERSION == "master" || ! $(tmux -V | grep $TMUX_VERSION) ]]; then ./configure --prefix=$HOME/build/tmux-$TMUX_VERSION && make && make install; fi
51+
- cd $TRAVIS_BUILD_DIR
4752
- tmux -V
4853
script:
4954
- py.test --cov

0 commit comments

Comments
 (0)