diff options
author | bartoszek | 2019-10-02 09:27:57 +0200 |
---|---|---|
committer | bartoszek | 2019-10-02 11:19:48 +0200 |
commit | 3ccc1189a670da2816c819d3275e9207805a1e74 (patch) | |
tree | 3e8b3eea4953eecce20ad9ad830357ce025a20b3 | |
parent | 836162118ac262d44865bde2909cce123cd0df98 (diff) | |
download | aur-3ccc1189a670da2816c819d3275e9207805a1e74.tar.gz |
Travis: Refactor and port changes from blender-2.8-git
* update arch-travis keyword arch: -> archlinux:
* default language=c
* build all branches
* cache out AUR-repo
* drop sample mount
* comment out bartus archlinux:repo:bartus
* incude oidn in aurchlinux:packages
* before_install: refactor comment, add gcc warning suppress flags
* move $update_interval from 'env:' to ':archlinux:script:'
* archlinux:script: add timeout logic, normalize TRAVIS.
* script: add timout logic, update arch-travis.sh url
* deploy: comment out until server set up.
Travis: fix skipp build logic
Continue if conditional is false.
-rw-r--r-- | .travis.yml | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/.travis.yml b/.travis.yml index 07b534a91a77..e6eb0022373f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,47 +1,47 @@ sudo: required +language: c branches: only: - - master + - /.*/ cache: directories: - ~/.ccache - ~/.pkg-cache - - AUR-repo - LuxCore.git -env: -# force update every n days - - update_interval=5 - services: - docker archlinux: mount: - ~/.ccache:~/.ccache - - ~/path with spaces:~/path with spaces - ~/.pkg-cache:/var/cache/pacman/pkg repos: - - bartus=https://github.com/bartoszek/AUR-repo/raw/master +# - bartus=https://github.com/bartoszek/AUR-repo/raw/master packages: - ccache - moreutils + - oidn - bc before_install: -# Override `package-cleanup.hook` to preserve cache for travis. -# Enable ccache -# Multithreaded build and compress +# 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 '/#MAKEFLAGS=/c MAKEFLAGS="-j2"' /etc/makepkg.conf 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: # check interval update - | + update_interval=5 update_offset=$(. PKGBUILD; sha1sum <<< "$pkgname"|sed -e "s/[a-z -]//g" -e "s/^0*//"|echo `cat`%$update_interval|bc) next_update=$(((365-`date +%j`+update_offset)%update_interval)) # check (opt|)depends update @@ -63,22 +63,32 @@ archlinux: # 2. no new version # 3. no dependency update - | - [[ "$TRAVIS_EVENT_TYPE" == "cron" && "$new_pkgver" == "$old_pkgver" && $next_update != 0 && $dep_update != 0 ]] && { echo -e "Current version is up to date!\nNext force update in $next_update days!"; exit 0; } -# exit with makepkg return code + [[ "$TRAVIS_EVENT_TYPE" == "cron" && "$new_pkgver" == "$old_pkgver" && $next_update != 0 && $dep_update != 0 ]] && { echo -e "Current version is up to date!\nNext force update in $next_update days!"; exit 0; } || true +# Normalize TRAVIS variable - | - set -o pipefail - makepkg -s --noconfirm TRAVIS=1 MAKEFLAGS='-j2' 2>&1 |ts -s '[%.T]' - makepkg_ret=$? - ccache -s - exit $makepkg_ret - + [ "$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/bartoszek/arch-travis/pacman-pkg-cache/arch-travis.sh |sed 's:mikkeloscar/arch-travis:bartoszek/arch-travis-bartus:'| bash" -- "echo 'pacman pkg cache size: ' $(du -h ~/.pkg-cache|cut -f1) in $(ls ~/.pkg-cache|wc -l) files" +- "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: - on: - branch: master - skip_cleanup: true - provider: script - script: bash .travis_deploy.sh +#deploy: +# on: +# branch: master +# skip_cleanup: true +# provider: script +# script: bash .travis_deploy.sh |