summarylogtreecommitdiffstats
path: root/.travis.yml
blob: 19e23e34b3a00e5cb4c33b448fceca982bcec611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
sudo: required

branches:
  only:
  - master

cache:
  directories:
  - ~/.ccache
  - ~/.pkg-cache
  - blender-addons-contrib.git
  - blender-addons.git
  - blender-dev-tools.git
  - blender-translations.git
  - blender

services:
- docker

arch:
  mount:
  - ~/.ccache:~/.ccache
  - ~/.pkg-cache:/var/cache/pacman/pkg
  repos:
  - bartus=https://github.com/bartoszek/AUR-repo/raw/master
  packages:
  - ccache
  - moreutils
  - cuda
  before_install:
#   Override `package-cleanup.hook` to preserve cache for travis.
#   Enable ccache
#   Multithreaded build and compress
#   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 '/^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:
#   Incorporate ccache in nvcc
  - |
     _gcc="$(readlink /opt/cuda/bin/gcc)"
     _gpp="$(readlink /opt/cuda/bin/g++)"
     sudo mv /opt/cuda/bin/nvcc /opt/cuda/bin/nvcc.bin
     sudo rm /opt/cuda/bin/g{cc,++}
     echo -e "#!/bin/sh -\n/usr/bin/ccache /opt/cuda/bin/nvcc.bin \"\$@\"" | sudo dd of=/opt/cuda/bin/nvcc
     echo -e "#!/bin/sh -\n/usr/bin/ccache $_gcc \"\$@\"" | sudo dd of=/opt/cuda/bin/gcc
     echo -e "#!/bin/sh -\n/usr/bin/ccache $_gpp \"\$@\"" | sudo dd of=/opt/cuda/bin/g++
     sudo chmod +x /opt/cuda/bin/{nvcc,g{cc,++}}
# Normalize TRAVIS variable
  - |
     [ "$TRAVIS" == "true" ] && TRAVIS=1 || TRAVIS=0
# Build
  - ccache -s
  - timeout 35m makepkg -s --noconfirm | ts -s '[%.T]'; _makepkg_return=${PIPESTATUS[0]}
  - ccache -s
  - exit $_makepkg_return
script:
- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/base64-encode/arch-travis.sh| 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