diff options
author | bartus | 2021-03-02 21:13:33 +0100 |
---|---|---|
committer | bartus | 2021-03-02 21:16:32 +0100 |
commit | f8c6af26eccfee30c7585408cbb1469fadab02f0 (patch) | |
tree | c6759da93213a264eb94125c203bac2f5cb081e5 | |
parent | 6b3adaea04c3bdc439b4315774d29d3cabd6ce8c (diff) | |
download | aur-f8c6af26eccfee30c7585408cbb1469fadab02f0.tar.gz |
Travis: init
-rw-r--r-- | .travis.yml | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..67646fc54b43 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,83 @@ +sudo: required +language: c + +branches: + only: + - master + +cache: + directories: + - ~/.ccache + - ~/.pkg-cache + - ~/.cache/yay + - alice-vision + - MeshSDFilter + - nanoflann + +services: +- docker + +archlinux: + mount: + - ~/.ccache:~/.ccache + - ~/.pkg-cache:/var/cache/pacman/pkg + - ~/.cache/yay:~/.cache/yay + repos: +# - bartus=https://github.com/bartoszek/AUR-repo/raw/master + packages: + - ccache + - ccache-ext +# cuda need to be installed before `makepkg` invocation in order to allow nvcc-ccache logic to work. + - cuda + - moreutils + - opengv-git + - flann + - coin-or-lemon + - ceres-solver + 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: +# 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-cache_out_time-60)) yay -S --noconfirm geogram popsift uncertainty-framework > >(ts -s '%.T') + - "arch_uptime=$(cut -d' ' -f1 /proc/uptime|cut -d'.' -f1)" + - timeout $((50*60-arch_uptime-cache_out_time-60)) makepkg -s --noconfirm > >(ts -s '%.T'); _makepkg_return=$? + - sudo pacman -Sc --noconfirm + - ccache -s + - ccache -z + - exit $_makepkg_return +script: +- export CCACHE_MAXSIZE=2G +- "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. +# detect no cache in and assume 5min cache out time. +- "[ $travis_uptime -le 60 ] && export cache_out_time=300 || export cache_out_time=$travis_uptime" +- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/master/arch-travis.sh| timeout $((50*60-travis_uptime-cache_out_time)) 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 |