forked from yixuan/spectra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
77 lines (69 loc) · 2.01 KB
/
.travis.yml
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
72
73
74
75
76
language: cpp
matrix:
include:
- os: linux
dist: focal
name: Linux, GCC 9
env: CC=gcc-9 CXX=g++-9
sudo: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-9
- g++-9
- os: linux
dist: focal
name: Linux, Clang 9
env: CC=clang-9 CXX=clang++-9
sudo: true
addons:
apt:
packages:
- clang-9
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-focal-9
before_cache:
- rm -rf $HOME/miniconda/locks $HOME/miniconda/pkgs $HOME/miniconda/var $HOME/miniconda/conda-meta/history
- pip uninstall -y cardboardlint
# Cache miniconda for faster build procedures
cache:
directories:
- $HOME/miniconda
- $HOME/download
before_install:
- |
set -ex
if [ -d $HOME/miniconda/bin ]; then
echo "Miniconda already installed.";
else
echo "Installing miniconda.";
rm -rf $HOME/miniconda;
mkdir -p $HOME/download;
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/download/miniconda.sh;
bash $HOME/download/miniconda.sh -b -p $HOME/miniconda
fi
set +ex
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
install:
# Configure conda
- source $HOME/miniconda/bin/activate
- hash -r
- conda config --set always_yes yes --set changeps1 no
# Install a recent version of CMake and Eigen if they are not yet installed
- if [ ! -f $HOME/miniconda/bin/cmake ]; then
conda install -c conda-forge cmake=3.13 eigen;
else
echo "Using already installed packages.";
fi
- export PATH=${HOME}/miniconda/bin:${PATH} # Use conda CMake
# Run the build script
script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir build && cd build
- cmake .. -DCMAKE_PREFIX_PATH=${HOME}/miniconda -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release
- make -j2 VERBOSE=1 && make test ARGS=-j2 && sudo make install