From e90eaf281fcb61d8fdde20ff7807d03ca515c22f Mon Sep 17 00:00:00 2001 From: Ale Martinez Date: Thu, 25 Jun 2020 15:19:12 -0300 Subject: [PATCH] Travis-ci cache Python packages to reduce build time on macOS [skip appveyor] Not a great difference, but we are too close to 50' limit Also reduce curl max time to avoid timouts. For Linux buils remove --silent build to avoid the job being cancelled --- .travis.yml | 1 + travis/linux/script.sh | 2 +- travis/osx/after_success.sh | 9 ++++----- travis/osx/before_script.sh | 5 +++++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5dd4e76f4..0f71b7133 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ cache: - $HOME/Library/Caches/Homebrew - qwt - D2XX + - site-packages env: global: diff --git a/travis/linux/script.sh b/travis/linux/script.sh index 3091a48f2..d218837c9 100755 --- a/travis/linux/script.sh +++ b/travis/linux/script.sh @@ -2,5 +2,5 @@ set -ev export PATH=/opt/qt514/bin:$PATH qmake -recursive QMAKE_CXXFLAGS_WARN_ON+="-Wno-deprecated-declarations -Wno-unused-value" QMAKE_CFLAGS_WARN_ON+="-Wno-deprecated-declarations -Wno-unused-value" -make --silent -j4 || make +make -j4 exit diff --git a/travis/osx/after_success.sh b/travis/osx/after_success.sh index a4a043817..a9a25b811 100755 --- a/travis/osx/after_success.sh +++ b/travis/osx/after_success.sh @@ -21,10 +21,9 @@ OLD_PATH=`otool -L GoldenCheetah.app/Contents/Frameworks/Python.framework/Versio echo $OLD_PATH install_name_tool -change $OLD_PATH "@executable_path/../Python" GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/bin/python3.7 install_name_tool -change $OLD_PATH "@executable_path/../../../../Python" GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python -# Add mandatory Python dependencies to site-packages -rm GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages -mkdir GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages -python3.7 -m pip install -r Python/requirements.txt -t GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages +# Add mandatory Python dependencies +rm -r GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages +cp -R ../site-packages GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7 # Initial deployment using macdeployqt /usr/local/opt/qt5/bin/macdeployqt GoldenCheetah.app -verbose=2 -executable=GoldenCheetah.app/Contents/MacOS/GoldenCheetah @@ -66,7 +65,7 @@ aws s3 rm s3://goldencheetah-binaries/MacOS --recursive # keep only the last one aws s3 cp --acl public-read $FINAL_NAME s3://goldencheetah-binaries/MacOS/$FINAL_NAME aws s3 cp --acl public-read GCversionMacOS.txt s3://goldencheetah-binaries/MacOS/GCversionMacOS.txt else -curl --max-time 300 --upload-file $FINAL_NAME https://transfer.sh/$FINAL_NAME +curl --max-time 150 --upload-file $FINAL_NAME https://transfer.sh/$FINAL_NAME fi echo "Make sure we are back in the Travis build directory" diff --git a/travis/osx/before_script.sh b/travis/osx/before_script.sh index 09095879b..8c11f0770 100755 --- a/travis/osx/before_script.sh +++ b/travis/osx/before_script.sh @@ -1,6 +1,11 @@ #!/bin/bash set -ev +# Python mandatory packages - refresh cache if folder is empty +if [ -z "$(ls -A site-packages)" ]; then + python3.7 -m pip install -r src/Python/requirements.txt -t site-packages +fi + # Python SIP python3 --version python3-config --prefix