Skip to content

Commit

Permalink
[ travis ] Reviving the travis builds
Browse files Browse the repository at this point in the history
The current commit makes the travis builds operational once again.
It's simply pulling the latest master from agda/agda & compiling
it so it's slow and prone to failure if master doesn't compile.

To speed up the build, .cabal and .ghc are cached using a script
taken from hvr/multi-ghc-travis
  • Loading branch information
gallais committed Jul 24, 2017
1 parent e827344 commit 782f961
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 20 deletions.
1 change: 0 additions & 1 deletion .dropbox_uploader.enc

This file was deleted.

68 changes: 49 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,60 @@
language: haskell
language: c
branches:
only:
- master

sudo: false

dist: trusty

cache:
directories:
- $HOME/.cabsnap

matrix:
include:
- env: TEST=MAIN GHC_VER=8.0.2 BUILD=CABAL CABAL_VER=1.24
addons:
apt:
packages:
- alex-3.1.7
- cabal-install-1.24
- ghc-8.0.2
- happy-1.19.5
sources:
- hvr-ghc

before_install:
# Decrypting the dropbox credentials
- openssl aes-256-cbc -K $encrypted_3f6e0f4132ed_key -iv $encrypted_3f6e0f4132ed_iv -in .dropbox_uploader.enc -out .dropbox_uploader -d
- cp .dropbox_uploader $HOME/
- 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:
# Installing the dropbox download script
- cd $HOME
- curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh
- chmod +x dropbox_uploader.sh
# downloading the last (latest?) tarball and installing agda
- AGDATAR=$(./dropbox_uploader.sh list | tail -n 1 | sed 's/^.*\(Agda.*\)$/\1/')
- ./dropbox_uploader.sh download $AGDATAR .
- tar -xzvf $AGDATAR
- cd $( basename $AGDATAR .tar.gz )
- sudo ./deploy.sh
- git clone https://github.com/agda/agda --depth=1 --single-branch
- cabal update
- sed -i 's/^jobs:/-- jobs:/' $HOME/.cabal/config
# 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/intallplan.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
- cabal install cpphs
- cd agda && cabal install --only-dependencies && make CABAL_OPTS=-v2 install-bin
# snapshot package-db on cache miss
- echo "snapshotting package-db to build-cache";
mkdir $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/;
# generating Everything.agda
- cabal install filemanip
- cd $HOME/build/agda/agda-stdlib
- runghc GenerateEverything.hs

Expand All @@ -46,7 +80,3 @@ after_success:
notifications:
email: false

# Github token
env:
global:
secure: f0GRSKTlAw6FdrvkI8LjP5ZhwcGBltJ1t5+nxipqfoR3VczMxcNgXD7bdwtUojFYR48jMs2W+LxEoJcuSH4bsdCeoSfpZ0nU424MDajGh0wuhAbSYKQXPWjFOxwMgC23sCySKhDAZiqN/Wd6orwV1p5JhuJkSCHdVeyUp+hLvIw=

0 comments on commit 782f961

Please sign in to comment.