Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 65115e0

Browse files
committed
Put the downloads in ~/Downloads
and put that directory in the Travis cache, for perhaps an additional speedup and to reduce the traffic we cause to the download sites
1 parent ea02ac1 commit 65115e0

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ cache:
1515
directories:
1616
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853
1717
- $HOME/.cache/matplotlib
18+
- $HOME/Downloads
1819

1920
addons:
2021
artifacts:

ci/osx-deps

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,32 @@ fold_end() {
1919
echo -e "travis_fold:end:$key\e[2K"
2020
}
2121

22+
cached_download() {
23+
file=$1
24+
url=$2
25+
shasum=$3
26+
path="$HOME/Downloads/$file"
27+
if [[ ! -f "$path"
28+
|| "$(shasum -a 256 "$HOME/Downloads/$file" | awk '{print $1}')" != "$shasum" ]]
29+
then
30+
curl -L -o "$path" "$url"
31+
fi
32+
}
33+
2234
fold_start Python "Install Python 3.8 from python.org"
23-
curl -O https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg
24-
sudo installer -package python-3.8.5-macosx10.9.pkg -target /
35+
cached_download python-3.8.5-macosx10.9.pkg \
36+
https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg \
37+
e27c5a510c10f830084fb9c60b9e9aa8719d92e4537a80e6b4252c02396f0d29
38+
sudo installer -package "$HOME"/Downloads/python-3.8.5-macosx10.9.pkg -target /
2539
sudo ln -s /usr/local/bin/python3 /usr/local/bin/python
2640
hash -r
2741
fold_end Python
2842

2943
fold_start ccache 'Install ccache (compile it ourselves)'
30-
curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz
31-
tar xf ccache-3.7.11.tar.xz
44+
cached_download ccache-3.7.11.tar.xz \
45+
https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz \
46+
8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68
47+
tar xf "$HOME"/Downloads/ccache-3.7.11.tar.xz
3248
pushd ccache-3.7.11
3349
./configure --prefix=/usr/local
3450
make
@@ -40,7 +56,9 @@ done
4056
fold_end ccache
4157

4258
fold_start freetype 'Install freetype (just unpack into the build directory)'
43-
curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz
59+
cached_download freetype-2.6.1.tar.gz \
60+
https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz \
61+
0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014
4462
mkdir -p build
45-
tar -x -C build -f freetype-2.6.1.tar.gz
63+
tar -x -C build -f "$HOME"/Downloads/freetype-2.6.1.tar.gz
4664
fold_end freetype

0 commit comments

Comments
 (0)