@@ -27,14 +27,36 @@ before_install:
27
27
install :
28
28
- cabal update
29
29
- sed -i 's/^jobs:/-- jobs:/' $HOME/.cabal/config
30
- # installing the dev version of Agda
31
- - cd ../
32
- - git clone https://github.com/agda/agda
33
- - cd agda
34
- - git checkout 08dd23df8dd894737af98463f0b3f69d616e7b48
30
+
31
+ # installing dependencies
32
+ - cabal install alex happy cpphs
33
+
34
+ # installing Agda
35
+ # Even if there seems to be duplicated code for master & experimental,
36
+ # DO NOT refactor: they regularly get out of sync (typically master
37
+ # builds with the released version while experimental uses some dev
38
+ # version).
39
+
40
+ # No matter the path, we should generate a $HOME/installplan.txt to
41
+ # check whether the cache needs updating.
42
+
43
+ - if [[ $TRAVIS_BRANCH = "master" ]]; then
44
+ cd ../ &&
45
+ git clone https://github.com/agda/agda &&
46
+ cd agda &&
47
+ git checkout 08dd23df8dd894737af98463f0b3f69d616e7b48 &&
48
+ cabal install --only-dependencies --dry -v > $HOME/installplan.txt ;
49
+ fi
50
+
51
+ - if [[ $TRAVIS_BRANCH = "experimental" ]]; then
52
+ cd ../ &&
53
+ git clone https://github.com/agda/agda &&
54
+ cd agda &&
55
+ git checkout c2d5ec4b2403c68d615b81258d6131774e492797 &&
56
+ cabal install --only-dependencies --dry -v > $HOME/installplan.txt ;
57
+ fi
58
+
35
59
# checking whether .ghc is still valid
36
- - cabal install alex happy
37
- - cabal install --only-dependencies --dry -v > $HOME/installplan.txt
38
60
- sed -i -e '1,/^Resolving /d' $HOME/installplan.txt; cat $HOME/installplan.txt
39
61
- touch $HOME/.cabsnap/installplan.txt
40
62
- mkdir -p $HOME/.cabsnap/ghc $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin
@@ -49,24 +71,40 @@ install:
49
71
rm -rf $HOME/.cabsnap;
50
72
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
51
73
fi
52
- - cabal install cpphs
53
- - cabal install
74
+
75
+ - if [[ $TRAVIS_BRANCH = "master" ]]; then
76
+ cabal install ;
77
+ fi
78
+
79
+ - if [[ $TRAVIS_BRANCH = "experimental" ]]; then
80
+ cabal install ;
81
+ fi
82
+
54
83
# snapshot package-db on cache miss
55
84
- echo "snapshotting package-db to build-cache";
56
85
mkdir $HOME/.cabsnap;
57
86
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
58
87
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin $HOME/installplan.txt $HOME/.cabsnap/;
59
- # returning to stdlib directory
60
- - cd ../agda-stdlib
88
+
89
+ - if [[ $TRAVIS_BRANCH = "master" ]]; then
90
+ cd ../ ;
91
+ fi
92
+
93
+ - if [[ $TRAVIS_BRANCH = "experimental" ]]; then
94
+ cd ../ ;
95
+ fi
96
+
61
97
# installing fix-whitespace
62
98
- git clone https://github.com/agda/fix-whitespace --depth=1
63
99
- cd fix-whitespace
64
100
- cabal install fix-whitespace.cabal
65
- - cd -
101
+ - cd ../
102
+
66
103
# generating Everything.agda
67
104
- cd agda-stdlib
68
105
- cabal install lib.cabal
69
106
- runghc GenerateEverything.hs
107
+
70
108
# setting up travis-specific scripts and files
71
109
- cp travis/* .
72
110
@@ -90,8 +128,14 @@ script:
90
128
# building the docs
91
129
- agda $RTS_OPTIONS -i . -i src/ --html safe.agda
92
130
- agda $RTS_OPTIONS -i . -i src/ --html index.agda
93
- # moving everything to the main directory
94
- - mv html/* .
131
+
132
+ # moving everything to the appropriate directory
133
+ - if [[ $TRAVIS_BRANCH = "master" ]]; then
134
+ mv html/* . ;
135
+ fi
136
+ - if [[ $TRAVIS_BRANCH = "experimental" ]]; then
137
+ mv html/* experimental/ ;
138
+ fi
95
139
96
140
after_success :
97
141
# uploading to gh-pages
@@ -100,11 +144,16 @@ after_success:
100
144
-
git config --global user.email "[email protected] "
101
145
-
git remote add upstream https://[email protected] /agda/agda-stdlib.git &>/dev/null
102
146
- git fetch upstream && git reset upstream/gh-pages
103
- - git checkout HEAD -- *.html v0.16/ v0.17/ v1.0/ v1.1/ v1.2/ experimental/
147
+ - if [[ $TRAVIS_BRANCH = "master" ]]; then
148
+ git checkout HEAD -- v0.16/ v0.17/ v1.0/ v1.1/ v1.2/ experimental/ ;
149
+ fi
150
+ - if [[ $TRAVIS_BRANCH = "experimental" ]]; then
151
+ git checkout HEAD -- *.html v0.16/ v0.17/ v1.0/ v1.1/ v1.2/ ;
152
+ fi
104
153
- git add -f \*.html
105
154
- git commit -m "Automatic HTML update via Travis"
106
- - if [ " $TRAVIS_PULL_REQUEST" = "false" ] && [ " $TRAVIS_BRANCH" = "master" ];
107
- then git push -q upstream HEAD:gh-pages &>/dev/null;
155
+ - if [[ $TRAVIS_PULL_REQUEST = "false" && ($TRAVIS_BRANCH = "master" || $TRAVIS_BRANCH = "experimental") ]]; then
156
+ git push -q upstream HEAD:gh-pages &>/dev/null;
108
157
fi
109
158
110
159
notifications :
0 commit comments