summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2019-10-02 17:46:10 +0200
committerbartus2019-10-02 17:49:21 +0200
commit587524ca89f3c286ec0aaefeac75b886a5e07ce7 (patch)
tree30d92d8a0c4b6efde6ed1d95e6841ba44cfeaa4c
parentb4aee5e3fba2f23fdc893933a3734923e1a1b860 (diff)
downloadaur-587524ca89f3c286ec0aaefeac75b886a5e07ce7.tar.gz
Travis: Port changes from blender-2.8-git
* default language:c * build all branches * add ccache support * cache /var/cache/pacman/pkg * cache src:OpenBoard.git * suppress gcc warings * utilize multithreaded build and compression * add timeout * suppress deploy until server set up
-rw-r--r--.travis.yml68
1 files changed, 50 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml
index 44fb708c57b..56aec06cebb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,34 +2,66 @@ sudo: required
branches:
only:
- - master
+ - /.*/
cache:
directories:
- - src
+ - ~/.ccache
+ - ~/.pkg-cache
+ - luxcorerender_v*.tar.gz
services:
- docker
archlinux:
+ mount:
+ - ~/.ccache:~/.ccache
+ - ~/.pkg-cache:/var/cache/pacman/pkg
repos:
-# - papyros=http://dash.papyros.io/repos/$repo/$arch
- - bartus=https://github.com/bartoszek/AUR-repo/raw/master
+# - bartus=https://github.com/bartoszek/AUR-repo/raw/master
packages:
- # arch/aur packages
-# - python
-# - perl
+ - ccache
+ - moreutils
+ - oidn
+ before_install:
+# 1.Override `package-cleanup.hook` to preserve cache for travis.
+# 2.Enable ccache
+# 3.Multithreaded build and compress
+# 4.Suppress all gcc warnings
+ - |
+ sudo mkdir /etc/pacman.d/hooks/
+ sudo ln -s /dev/null /etc/pacman.d/hooks/package-cleanup.hook
+ sudo sed -i '/^BUILDENV/s/\!ccache/ccache/' /etc/makepkg.conf
+ sudo sed -i '/#MAKEFLAGS=/c MAKEFLAGS="-j2"' /etc/makepkg.conf
+ sudo sed -i '/^COMPRESSXZ/s/\xz/xz -T 2/' /etc/makepkg.conf
+ sudo sed -i '$a CFLAGS="$CFLAGS -w"' /etc/makepkg.conf
+ sudo sed -i '$a CXXFLAGS="$CXXFLAGS -w"' /etc/makepkg.conf
script:
-# - "sudo pacman -Sy"
- - "makepkg -s --noconfirm"
-
+# Normalize TRAVIS variable
+ - |
+ [ "$TRAVIS" == "true" ] && TRAVIS=1 || TRAVIS=0
+# Build
+ - 'echo "Travis initialization time: $travis_uptime seconds"'
+ - "arch_uptime=$(cut -d' ' -f1 /proc/uptime|cut -d'.' -f1)"
+ - 'echo "Arch-Travis initialization time: $((arch_uptime-travis_uptime)) seconds"'
+ - ccache -s
+ - ccache -z
+# set timeout to 50m minus current uptime, minus travis cache in time, minus 60 second buffer for arch-travis cleanup.
+ - timeout $((50*60-arch_uptime-travis_uptime-60)) makepkg -s --noconfirm > >(ts -s '%.T'); _makepkg_return=$?
+ - sudo pacman -Sc --noconfirm
+ - ccache -s
+ - ccache -z
+ - exit $_makepkg_return
script:
-- "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"
-- "ls $(pwd)"
+- "export travis_uptime=$(cut -d' ' -f1 /proc/uptime|cut -d'.' -f1)"
+- 'echo "Travis initialization time: $travis_uptime seconds"'
+# assume caching out will take the same amount of time as caching in those making build time equal to 50 minutes minus two time current uptime.
+- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/master/arch-travis.sh| timeout $((50*60-2*travis_uptime)) bash"
+- "echo pacman pkg cache size: $(du -h ~/.pkg-cache|cut -f1) in $(ls ~/.pkg-cache|wc -l) files"
-deploy:
- provider: script
- script: bash .travis_deploy.sh
- on:
- branch: master
- skip_cleanup: true
+#deploy:
+# on:
+# branch: master
+# skip_cleanup: true
+# provider: script
+# script: bash .travis_deploy.sh