-
Notifications
You must be signed in to change notification settings - Fork 26
/
.travis.yml
209 lines (192 loc) · 6.67 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
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.10.4 COGENT_BUILD_FLAGS="$COGENT_FULL_FEATURE -llvm-backend"
# llvm-hs doesn't yet support new ghc versions.
compiler: "ghc-8.10.4"
addons:
apt:
packages:
- cabal-install-3.2
- ghc-8.10.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
- env: CABALVER=3.2 GHCVER=8.10.4 COGENT_BUILD_FLAGS=$COGENT_NO_FEATURE
compiler: "ghc-8.10.4"
addons: {apt: {packages: [cabal-install-3.2,ghc-8.10.4,alex-3.1.7,happy-1.19.5], sources: [hvr-ghc], config: {retries: true}}}
- 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.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