blob: 33d2597ef8d0692be2bcdbcf8ed180e0687db841 [file] [log] [blame] [edit]
language: python
python:
- "3.7"
# sudo: required
dist: xenial
os: linux
group: edge
git:
submodules: false
branches:
except:
- /^auto-deploy-.*$/
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
- $HOME/z3
before_cache:
env:
global:
- REPO=$TRAVIS_BUILD_DIR
- TRAVIS_BUILD_APT_RETRIES_PERCENTAGE=100
- COGENT_FULL_FEATURE="+builtin-arrays +refinement-types +docgent +haskell-backend +llvm-backend"
- COGENT_NO_FEATURE="-builtin-arrays -refinement-types -docgent -haskell-backend -llvm-backend"
jobs:
include:
- env: CABALVER=3.2 GHCVER=8.8.3 COGENT_BUILD_FLAGS=$COGENT_FULL_FEATURE
compiler: "ghc-8.8.3"
addons:
apt:
packages:
- cabal-install-3.2
- ghc-8.8.3
- alex-3.1.7
- happy-1.19.5
- clang-9
- llvm-9-dev
sources:
- hvr-ghc
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
config:
retries: true
- env: CABALVER=3.2 GHCVER=8.8.3 COGENT_BUILD_FLAGS=$COGENT_NO_FEATURE
compiler: "ghc-8.8.3"
addons: {apt: {packages: [cabal-install-3.2,ghc-8.8.3,alex-3.1.7,happy-1.19.5], sources: [hvr-ghc], config: {retries: true}}}
- env: CABALVER=3.2 GHCVER=8.6.5 COGENT_BUILD_FLAGS=$COGENT_FULL_FEATURE
compiler: "ghc-8.6.5"
addons:
apt:
packages:
- cabal-install-3.2
- ghc-8.6.5
- alex-3.1.7
- happy-1.19.5
- clang-9
- llvm-9-dev
sources:
- hvr-ghc
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
config:
retries: truea
- env: CABALVER=3.2 GHCVER=8.4.4 COGENT_BUILD_FLAGS=$COGENT_FULL_FEATURE
compiler: "ghc-8.4.4"
addons:
apt:
packages:
- cabal-install-3.2
- ghc-8.4.4
- alex-3.1.7
- happy-1.19.5
- clang-9
- llvm-9-dev
sources:
- hvr-ghc
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
config:
retries: true
allow_failures:
# I know that some dependency triggers ghc panic in that version. / zilinc
fast_finish: true
before_install:
- unset CC
- export ALEXVER=3.1.7
- export HAPPYVER=1.19.5
- export PATH=/usr/lib/llvm-9/bin:~/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:/opt/happy/$HAPPYVER/bin:/opt/alex/$ALEXVER/bin:$PATH
- clang --version
- llvm-config --version
# - pip --version
# - sudo pip --version
- pip install termcolor ruamel.yaml
install:
# Get AutoCorres
- wget http://ts.data61.csiro.au/projects/TS/autocorres/autocorres-1.6.tar.gz
- tar -xf autocorres-1.6.tar.gz
- mv autocorres-1.6 autocorres
# setup Cabal
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal new-update # -v
- cd cogent
- "sed -i 's/^jobs:.*$/jobs: 2/' $HOME/.cabal/config"
# - sed -i 's/^jobs:/ jobs:/' ${HOME}/.cabal/config
- cabal new-configure --flags="$COGENT_BUILD_FLAGS" --with-compiler=ghc-$GHCVER --enable-tests
- cat cabal.project.local
- travis_wait 70 cabal new-install --install-method=copy --installdir=$HOME/.cabal/bin --overwrite-policy=always
# Install z3
- cd $REPO
- git submodule update --init -- z3
- cd z3
- mkdir -p "$HOME"/z3
- export PATH="$HOME/z3/bin:$PATH"
- |
if ! which z3;
then # install z3
python scripts/mk_make.py --prefix="$HOME/z3"
cd build
make
make install
fi
- which z3 || travis_terminate 1
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
script:
- cd $REPO/cogent
- travis_wait 50 cabal new-test test-quickcheck # the other test is rarely affacted, so not enabled / zilinc
# - cabal check
- cabal new-haddock
# Check if Cogent has been correctly installed
- which cogent || travis_terminate 1
# - echo 'Running tests'
- make test-compiler
# - echo 'Typechecking libgum'
- make test-libgum
# - echo 'Building Cogent examples'
- make examples
# - echo 'Generating ext2fs C code from Cogent'
- cd $REPO/impl/fs/ext2/cogent && travis_wait make .c-gen
# - echo 'Generating BilbyFs C code from Cogent'
- cd $REPO/impl/fs/bilby/cogent && travis_wait make .c-gen
before_deploy:
# - git fetch --tags
# - git remote add origin-tmp https://${GITHUB_TOKEN}@github.com/NICTA/cogent.git
# # I don't dare to use `git push --delete [ref ..] as it's too risky
# - |
# for tag in $(git tag -l "auto-deploy-*")
# do
# git push origin-tmp :refs/tags/$tag
# done
deploy:
provider: releases
edge: true
token: $GITHUB_TOKEN
cleanup: false
file_glob: false
file: $HOME/.cabal/bin/cogent
draft: false
prerelease: true
tag_name: auto-deploy-$TRAVIS_BUILD_NUMBER
name: "Cogent Compiler (${TRAVIS_BUILD_NUMBER})"
overwrite: true
on:
branch: master
condition: $GHCVER = 8.8.3 && $COGENT_BUILD_FLAGS = $COGENT_FULL_FEATURE
after_deploy:
- cd $REPO
- gem install octokit
- ruby post-deploy.rb
notifications:
slack:
secure: M7TA9nizOnLT7TLO+T9SqAx1rZ6OiOMfYKkESONQxU5PMoLnfDy8M5Apmvxge11uEoG6hLICAzFnu/seO2wz05xl/4YVaIRM6o7QXkT3iORSOhAtKn6lk/37KbR18eRh9w0YKPuHr+KLtcS1u+PNDAxWyRehs6eEU7HjVa+tLRhekTduIhCA7ePtp4d3mLF9nIVXILrO66JTCvzxkyQwDjvAKROYC07eeGUqw2I28d1Bz3cjt4yyOspVTafWJlBHQQPk9mL5ffSFhJSh004uMii2+PPXEJ7h9tdBcgZJ0BxrrfK+gqXe1USfmTlU9DfSWVzECrew6USXiIY7saqOi8Qr29QhEMViIOzS6NdQwQoxzbpmxejfMLRvP8jP1gJcggaayGo5SNwF/3WivFbixun1SxMEy/Kt6Yy0VJuuD6FQsCwE5cnPu8zMDK6kzYV0O2aCPGCTQkPr16aB4x4ofasapTCdSc8eodmdk8SWPf4n5CF8QXwKkCAM2GwiMo8xbsckYgXJJvoPdGaeOYihTyvsPg0kag8GWFZFI/zQC+IB5ou0ZLqfeojkRX1mc7YF8vjKRZK1hjJA2AafOc1/hheu/aDtCquhdF7fALpJuy4groX4MpESLSs2vmBxhnTW0QYt3htcCxz335RGNuBZKXt9xJOxtsolfDZUtcZGyJ0=
# EOF