-
Notifications
You must be signed in to change notification settings - Fork 57
/
.travis.yml
50 lines (42 loc) · 2.4 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
# dist should be at least focal because we need cppcheck >= 1.88.
dist: focal
# NB: don't set `language: haskell` here
# The following enables several GHC versions to be tested; often it's enough to
# test only against the last release in a major GHC version. Feel free to omit
# lines listings versions you don't need/want testing for.
env:
- CABALVER=2.4 GHCVER=8.6.5
- CABALVER=3.2 GHCVER=8.8.4
- CABALVER=3.2 GHCVER=8.10.4
- CABALVER=3.4 GHCVER=9.0.1
# - CABALVER=head GHCVER=head # see section about GHC HEAD snapshots
# Note: the distinction between `before_install` and `install` is not important.
before_install:
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER # see note about happy/alex
# We install z3 and cppcheck only for the tests, since they are not needed
# for normal compilation.
- if [ "${GHCVER}" == "8.10.4" ]; then travis_retry sudo apt-get install --yes z3 cppcheck; fi
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update
- git submodule update --remote
script:
# We explicitly install all libraries so that they are exposed and we can use
# them for tests (e.g., with runhaskell). There is no harm in doing this
# instead of installing just copilot.
- travis_wait 30 cabal v2-install --lib copilot copilot-core copilot-c99 copilot-language copilot-libraries copilot-theorem copilot-interpreter copilot-prettyprinter
# Run tests only on GHC 8.10.4
#
# Only libraries with tests are listed below or the v2-test command fails.
#
# Testing copilot-theorem and copilot-libraries requires z3. See above
# conditional installation, and keep GHC version numbers in both places in
# sync.
- if [ "${GHCVER}" == "8.10.4" ]; then cabal v2-test -j1 copilot-core copilot-language copilot-interpreter copilot-c99 copilot-theorem copilot-libraries; fi
# Check that the code produced by Copilot complies with MISRA C 2012. We
# explicitly make cppcheck produce a non-zero exit code on non-compliance
# with the standard to make the CI build fail.
- if [ "${GHCVER}" == "8.10.4" ]; then runhaskell copilot/examples/Heater.hs; cppcheck --force --addon=misra.py --suppress=misra-c2012-14.4 --error-exitcode=2 heater.c; fi