Skip to content

Commit 5f2ed1c

Browse files
authored
Merge pull request #10 from fendor/commit-travis-ci-script
Add .travis.yml
2 parents 5637343 + 57afb95 commit 5f2ed1c

File tree

4 files changed

+159
-10
lines changed

4 files changed

+159
-10
lines changed

.travis.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# This Travis job script has been generated by a script via
2+
#
3+
# haskell-ci '--hlint' '--tests' 'implicit-hie.cabal'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
8+
#
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
10+
#
11+
# version: 0.10.1
12+
#
13+
version: ~> 1.0
14+
language: c
15+
os: linux
16+
dist: xenial
17+
git:
18+
# whether to recursively clone submodules
19+
submodules: false
20+
cache:
21+
directories:
22+
- $HOME/.cabal/packages
23+
- $HOME/.cabal/store
24+
- $HOME/.hlint
25+
before_cache:
26+
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
27+
# remove files that are regenerated by 'cabal update'
28+
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
29+
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
30+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
31+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
32+
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
33+
- rm -rfv $CABALHOME/packages/head.hackage
34+
jobs:
35+
include:
36+
- compiler: ghc-8.8.3
37+
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.3","cabal-install-3.2"]}}
38+
os: linux
39+
before_install:
40+
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
41+
- WITHCOMPILER="-w $HC"
42+
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
43+
- HCPKG="$HC-pkg"
44+
- unset CC
45+
- CABAL=/opt/ghc/bin/cabal
46+
- CABALHOME=$HOME/.cabal
47+
- export PATH="$CABALHOME/bin:$PATH"
48+
- TOP=$(pwd)
49+
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
50+
- echo $HCNUMVER
51+
- CABAL="$CABAL -vnormal+nowrap"
52+
- set -o pipefail
53+
- TEST=--enable-tests
54+
- BENCH=--enable-benchmarks
55+
- HEADHACKAGE=false
56+
- rm -f $CABALHOME/config
57+
- |
58+
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
59+
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
60+
echo "write-ghc-environment-files: always" >> $CABALHOME/config
61+
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
62+
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
63+
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
64+
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
65+
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
66+
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
67+
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
68+
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
69+
echo "install-dirs user" >> $CABALHOME/config
70+
echo " prefix: $CABALHOME" >> $CABALHOME/config
71+
echo "repository hackage.haskell.org" >> $CABALHOME/config
72+
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
73+
install:
74+
- ${CABAL} --version
75+
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
76+
- |
77+
echo "program-default-options" >> $CABALHOME/config
78+
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
79+
- cat $CABALHOME/config
80+
- rm -fv cabal.project cabal.project.local cabal.project.freeze
81+
- travis_retry ${CABAL} v2-update -v
82+
- HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $WITHCOMPILER --dry-run hlint --constraint='hlint ==3.1.*' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER"
83+
- "if [ ! -e $HOME/.hlint/hlint-$HLINTVER/hlint ]; then echo \"Downloading HLint version $HLINTVER\"; mkdir -p $HOME/.hlint; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\\n' --silent --location --output $HOME/.hlint/hlint-$HLINTVER.tar.gz \"https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz\"; tar -xzv -f $HOME/.hlint/hlint-$HLINTVER.tar.gz -C $HOME/.hlint; fi"
84+
- mkdir -p $CABALHOME/bin && ln -sf "$HOME/.hlint/hlint-$HLINTVER/hlint" $CABALHOME/bin/hlint
85+
- hlint --version
86+
# Generate cabal.project
87+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
88+
- touch cabal.project
89+
- |
90+
echo "packages: ." >> cabal.project
91+
- echo 'package implicit-hie' >> cabal.project
92+
- "echo ' ghc-options: -Werror=missing-methods' >> cabal.project"
93+
- |
94+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(implicit-hie)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
95+
- cat cabal.project || true
96+
- cat cabal.project.local || true
97+
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
98+
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
99+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
100+
- rm cabal.project.freeze
101+
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
102+
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
103+
script:
104+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
105+
# Packaging...
106+
- ${CABAL} v2-sdist all
107+
# Unpacking...
108+
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
109+
- cd ${DISTDIR} || false
110+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
111+
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
112+
- PKGDIR_implicit_hie="$(find . -maxdepth 1 -type d -regex '.*/implicit-hie-[0-9.]*')"
113+
# Generate cabal.project
114+
- rm -rf cabal.project cabal.project.local cabal.project.freeze
115+
- touch cabal.project
116+
- |
117+
echo "packages: ${PKGDIR_implicit_hie}" >> cabal.project
118+
- echo 'package implicit-hie' >> cabal.project
119+
- "echo ' ghc-options: -Werror=missing-methods' >> cabal.project"
120+
- |
121+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(implicit-hie)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
122+
- cat cabal.project || true
123+
- cat cabal.project.local || true
124+
# Building...
125+
# this builds all libraries and executables (without tests/benchmarks)
126+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
127+
# Building with tests and benchmarks...
128+
# build & run tests, build benchmarks
129+
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
130+
# Testing...
131+
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
132+
# HLint..
133+
- (cd ${PKGDIR_implicit_hie} && hlint src)
134+
- (cd ${PKGDIR_implicit_hie} && hlint app)
135+
# cabal check...
136+
- (cd ${PKGDIR_implicit_hie} && ${CABAL} -vnormal check)
137+
# haddock...
138+
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
139+
# Building without installed constraints for packages in global-db...
140+
- rm -f cabal.project.local
141+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
142+
143+
# REGENDATA ("0.10.1",["--hlint","--tests","implicit-hie.cabal"])
144+
# EOF

implicit-hie.cabal

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ build-type: Simple
2323
extra-source-files:
2424
README.md
2525
ChangeLog.md
26+
test/benchSection
27+
test/cabal.project
28+
test/hie.yaml.cbl
29+
test/stackHie.yaml
30+
test/haskell-language-server-cabal
2631

2732
source-repository head
2833
type: git

test/hie.yaml.cbl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
cradle:
22
cabal:
3-
- path: "./src"
3+
- path: "src"
44
component: "lib:haskell-language-server"
55

6-
- path: "./exe/Main.hs"
6+
- path: "exe/Main.hs"
77
component: "haskell-language-server:exe:haskell-language-server"
88

9-
- path: "./exe/Arguments.hs"
9+
- path: "exe/Arguments.hs"
1010
component: "haskell-language-server:exe:haskell-language-server"
1111

12-
- path: "./exe/Wrapper.hs"
12+
- path: "exe/Wrapper.hs"
1313
component: "haskell-language-server:exe:haskell-language-server-wrapper"
1414

15-
- path: "./exe/Arguments.hs"
15+
- path: "exe/Arguments.hs"
1616
component: "haskell-language-server:exe:haskell-language-server-wrapper"
1717

18-
- path: "./test/functional"
18+
- path: "test/functional"
1919
component: "haskell-language-server:test:func-test"
2020

21-
- path: "./test/utils"
21+
- path: "test/utils"
2222
component: "haskell-language-server:lib:hls-test-utils"

test/stackHie.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
cradle:
22
stack:
3-
- path: "./src"
3+
- path: "src"
44
component: "implicit-hie:lib"
55

6-
- path: "./app/Main.hs"
6+
- path: "app/Main.hs"
77
component: "implicit-hie:exe:gen-hie"
88

9-
- path: "./test"
9+
- path: "test"
1010
component: "implicit-hie:test:implicit-hie-test"

0 commit comments

Comments
 (0)