forked from agda/cubical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (76 loc) · 2.49 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
77
78
79
80
81
82
language: c
branches:
only:
- master
- travis
dist: xenial
cache:
directories:
- $HOME/.cabsnap
matrix:
include:
- env: TEST=MAIN GHC_VER=8.4.4 BUILD=CABAL CABAL_VER=2.2
addons:
apt:
packages:
- alex-3.1.7
- cabal-install-2.2
- ghc-8.4.4
- happy-1.19.5
sources:
- hvr-ghc
before_install:
- export PATH=/opt/ghc/$GHC_VER/bin:/opt/cabal/$CABAL_VER/bin:/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:~/.cabal/bin/:$PATH;
install:
- cd
- cabal update
- sed -i 's/^jobs:/-- jobs:/' $HOME/.cabal/config
# get master Agda
- git clone https://github.com/agda/agda --depth=1
- cd agda
# checking whether .ghc is still valid
- cabal install --only-dependencies --dry -v > $HOME/installplan.txt
- sed -i -e '1,/^Resolving /d' $HOME/installplan.txt; cat $HOME/installplan.txt
- touch $HOME/.cabsnap/installplan.txt
- mkdir -p $HOME/.cabsnap/ghc $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin
- if diff -u $HOME/.cabsnap/installplan.txt $HOME/installplan.txt;
then
echo "cabal build-cache HIT";
rm -rfv .ghc;
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
else
echo "cabal build-cache MISS";
rm -rf $HOME/.cabsnap/*;
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
fi
# only install agda if we have to
- touch $HOME/.cabsnap/oldHEAD.txt
- git rev-parse HEAD; cat $HOME/.cabsnap/oldHEAD.txt # for logging purposes
- if [ agda ] && [ "$(git rev-parse HEAD)" == "$(cat $HOME/.cabsnap/oldHEAD.txt)" ];
then
echo "agda up to date";
else
echo "**** cached build of agda is out of date, re-installing (this will take 20-30m) ****";
travis_wait 30 cabal install --only-dependencies;
travis_wait 30 cabal install;
fi
# installing fix-agda-whitespace
- cd -
- git clone https://github.com/agda/fix-whitespace --depth=1
- cd fix-whitespace
- cabal install fix-whitespace.cabal
- cd -
- yes | rm -R fix-whitespace
# snapshot package-db on cache miss
- cd agda
- echo "snapshotting package-db to build-cache";
mkdir -p $HOME/.cabsnap;
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin $HOME/installplan.txt $HOME/.cabsnap/;
git rev-parse HEAD > $HOME/.cabsnap/oldHEAD.txt;
- cd
- yes | rm -R agda/
- cd $TRAVIS_BUILD_DIR
script:
- make test