Skip to content

Commit 1bf8299

Browse files
committed
[ travis ] bring merged .travis.yml over from master
1 parent 71c8a50 commit 1bf8299

File tree

1 file changed

+66
-17
lines changed

1 file changed

+66
-17
lines changed

.travis.yml

Lines changed: 66 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,36 @@ before_install:
2727
install:
2828
- cabal update
2929
- 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+
3559
# checking whether .ghc is still valid
36-
- cabal install alex happy
37-
- cabal install --only-dependencies --dry -v > $HOME/installplan.txt
3860
- sed -i -e '1,/^Resolving /d' $HOME/installplan.txt; cat $HOME/installplan.txt
3961
- touch $HOME/.cabsnap/installplan.txt
4062
- mkdir -p $HOME/.cabsnap/ghc $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin
@@ -49,24 +71,40 @@ install:
4971
rm -rf $HOME/.cabsnap;
5072
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
5173
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+
5483
# snapshot package-db on cache miss
5584
- echo "snapshotting package-db to build-cache";
5685
mkdir $HOME/.cabsnap;
5786
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
5887
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+
6197
# installing fix-whitespace
6298
- git clone https://github.com/agda/fix-whitespace --depth=1
6399
- cd fix-whitespace
64100
- cabal install fix-whitespace.cabal
65-
- cd -
101+
- cd ../
102+
66103
# generating Everything.agda
67104
- cd agda-stdlib
68105
- cabal install lib.cabal
69106
- runghc GenerateEverything.hs
107+
70108
# setting up travis-specific scripts and files
71109
- cp travis/* .
72110

@@ -90,8 +128,14 @@ script:
90128
# building the docs
91129
- agda $RTS_OPTIONS -i . -i src/ --html safe.agda
92130
- 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
95139

96140
after_success:
97141
# uploading to gh-pages
@@ -100,11 +144,16 @@ after_success:
100144
- git config --global user.email "[email protected]"
101145
- git remote add upstream https://[email protected]/agda/agda-stdlib.git &>/dev/null
102146
- 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
104153
- git add -f \*.html
105154
- 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;
108157
fi
109158

110159
notifications:

0 commit comments

Comments
 (0)