on master help sign in
use the new packcheck script for CI
9adb002Harendra Kumar
.travis.yml+53−43
@@ -1,26 +1,23 @@
1notifications:
1notifications:
2 email: false
2 email: false
3
3
4+env:
5+ global:
6+ - GHC_OPTIONS="-O0 -Werror"
7+ - PACKCHECK="./packcheck.sh"
8+ # The commit id of packcheck.sh to use from harendra-kumar/packcheck on github
9+ - PACKCHECK_COMMIT="c028c2425a372487e74157569d0a6cd4d745575d"
10+
4matrix:
11matrix:
5 include:
12 include:
6
13
7 # --------------------------------------------------------------------------
14 # --------------------------------------------------------------------------
8− # Linux/cabal builds
9− # cabal builds require pre-installed cabal-install and ghc
10− # --------------------------------------------------------------------------
11−
12− # Note COVERALLS (hpc-coveralls) requires cabal build. Sends the coverage
13− # info for the test suite named "test" to coveralls.io using hpc-coveralls.
14− - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 COVERALLS_OPTIONS="--coverage-mode=StrictlyFullLines --exclude-dir=test test"
15− addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
16−
17− # --------------------------------------------------------------------------
18− # Linux/stack builds
15+ # (Linux) stack builds
19 # --------------------------------------------------------------------------
16 # --------------------------------------------------------------------------
20
17
21 # GHC 7.10.3
18 # GHC 7.10.3
22 - env: BUILD=stack RESOLVER=lts-6.35 STACK_YAML=stack-7.10.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
19 - env: BUILD=stack RESOLVER=lts-6.35 STACK_YAML=stack-7.10.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
23− addons: {apt: {packages: [libgmp-dev,libsdl1.2-dev]}}
20+ addons: {apt: {packages: [libsdl1.2-dev]}}
24
21
25 # GHC 8.0.2
22 # GHC 8.0.2
26 - env: BUILD=stack RESOLVER=lts-9.20 STACK_YAML=stack-8.0.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
23 - env: BUILD=stack RESOLVER=lts-9.20 STACK_YAML=stack-8.0.yaml STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
@@ -33,11 +30,24 @@ matrix:
33 # Nightly
30 # Nightly
34 - env: BUILD=stack RESOLVER=nightly
31 - env: BUILD=stack RESOLVER=nightly
35
32
33+ # --------------------------------------------------------------------------
34+ # (Linux) cabal builds require pre-installed cabal-install and ghc
35+ # --------------------------------------------------------------------------
36+
37+ - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22
38+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
39+
40+ - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24
41+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
42+
43+ - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0
44+ addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
45+
36 # --------------------------------------------------------------------------
46 # --------------------------------------------------------------------------
37 # OS X builds
47 # OS X builds
38 # --------------------------------------------------------------------------
48 # --------------------------------------------------------------------------
39
49
40− # GHC 8.2.2/cabal
50+ # GHC 8.2.2/cabal build via stack
41 - env: BUILD=cabal RESOLVER=lts-10.0
51 - env: BUILD=cabal RESOLVER=lts-10.0
42 os: osx
52 os: osx
43
53
@@ -51,6 +61,15 @@ matrix:
51
61
52 - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
62 - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
53
63
64+ # --------------------------------------------------------------------------
65+ # Build and send coverage report to coveralls.io using hpc-coveralls
66+ # --------------------------------------------------------------------------
67+
68+ # Note COVERALLS (hpc-coveralls) works only with cabal build.
69+ # For this to succeed you have to add your porject to coveralls.io first
70+ - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 COVERALLS_OPTIONS="--coverage-mode=StrictlyFullLines --exclude-dir=test test"
71+ addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
72+
54 # --------------------------------------------------------------------------
73 # --------------------------------------------------------------------------
55 # Builds that are allowed to fail
74 # Builds that are allowed to fail
56 # --------------------------------------------------------------------------
75 # --------------------------------------------------------------------------
@@ -59,22 +78,22 @@ matrix:
59 - env: BUILD=stack RESOLVER=nightly
78 - env: BUILD=stack RESOLVER=nightly
60 - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
79 - env: BUILD=stack RESOLVER=lts-10.0 HLINT_OPTIONS="."
61
80
62−script:
81+# ------------------------------------------------------------------------
63− - |
82+# Settings beyond this point are advanced and normally not tweaked
64− # ------------------------------------------------------------------------
65− # You can customize these to desired values
66− # ------------------------------------------------------------------------
83+# ------------------------------------------------------------------------
67−
68− # The commit id of the package-test script to use
69− PACKAGE_TEST_VER="1a4de26422ee296f0811e032bec922123f019963"
70− GHC_OPTIONS="-O0 -Werror"
71
84
72− # ------------------------------------------------------------------------
85+sudo: false
73− # Normally no customizations should be needed this point onwards
86+cache:
74− # ------------------------------------------------------------------------
87+ directories:
88+ - $HOME/.cabal
89+ - $HOME/.ghc
90+ - $HOME/.local
91+ - $HOME/.stack
75
92
93+script:
94+ - |
76− # Where to find the package-test.sh script
95+ # Where to find the packcheck.sh script
77− pkg_test() { echo https://raw.githubusercontent.com/harendra-kumar/package-test/$1/package-test.sh; }
96+ PACKCHECK_URL=https://raw.githubusercontent.com/harendra-kumar/packcheck/${PACKCHECK_COMMIT}/packcheck.sh
78
97
79 # When GHCVER or CABALVER env variables are specified, modify the path to
98 # When GHCVER or CABALVER env variables are specified, modify the path to
80 # find the binaries installed from hvr-ghc repo
99 # find the binaries installed from hvr-ghc repo
@@ -88,6 +107,11 @@ script:
88 add_path GHCVER ghc
107 add_path GHCVER ghc
89 add_path CABALVER cabal
108 add_path CABALVER cabal
90
109
110+ # If a custom stack-yaml is specified, replace the default with that
111+ if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
112+ if test ! -e "$PACKCHECK"; then $CURL -sL -o "$PACKCHECK" $PACKCHECK_URL; fi;
113+ chmod +x $PACKCHECK
114+
91 # We start with a clean environment (env -i) and specify all the
115 # We start with a clean environment (env -i) and specify all the
92 # environment variables explicitly. TRAVIS vars are needed by
116 # environment variables explicitly. TRAVIS vars are needed by
93 # hpc-coveralls.
117 # hpc-coveralls.
@@ -95,11 +119,9 @@ script:
95 LC_ALL=C.UTF-8
119 LC_ALL=C.UTF-8
96 TRAVIS=$TRAVIS
120 TRAVIS=$TRAVIS
97 TRAVIS_JOB_ID=$TRAVIS_JOB_ID
121 TRAVIS_JOB_ID=$TRAVIS_JOB_ID
98− PATH=$PATH
122+ PATH="$PATH"
99− BUILD=$BUILD
100 RESOLVER=$RESOLVER
123 RESOLVER=$RESOLVER
101 STACK_UPGRADE=y
124 STACK_UPGRADE=y
102− STACK_YAML="$STACK_YAML"
103 STACK_BUILD_OPTIONS="$STACK_BUILD_OPTIONS"
125 STACK_BUILD_OPTIONS="$STACK_BUILD_OPTIONS"
104 GHCVER=$GHCVER
126 GHCVER=$GHCVER
105 GHC_OPTIONS="$GHC_OPTIONS"
127 GHC_OPTIONS="$GHC_OPTIONS"
@@ -111,19 +133,7 @@ script:
111 $(cabal_env CABAL_NO_SANDBOX=y)
133 $(cabal_env CABAL_NO_SANDBOX=y)
112 $(cabal_env CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com)
134 $(cabal_env CABAL_HACKAGE_MIRROR=hackage.haskell.org:http://hackage.fpcomplete.com)
113 HLINT_OPTIONS="$HLINT_OPTIONS"
135 HLINT_OPTIONS="$HLINT_OPTIONS"
114− /bin/bash <($CURL -sL $(pkg_test $PACKAGE_TEST_VER))
136+ bash -c "$PACKCHECK $BUILD"
115
137
116install: true
138install: true
117language: c
139language: c
118−
119−# ------------------------------------------------------------------------
120−# Build caching
121−# ------------------------------------------------------------------------
122−
123−sudo: false
124−cache:
125− directories:
126− - $HOME/.cabal
127− - $HOME/.ghc
128− - $HOME/.local
129− - $HOME/.stack
appveyor.yml+13−16
@@ -1,41 +1,38 @@
1−# short paths == fewer problems
2−
3−# criterion does not support 32-bit on Windows
4−# TODO disable benchmarking to test on 32-bit
5−platform: x64
6−
7−clone_folder: "c:\\pkg"
8environment:
1environment:
9 global:
2 global:
10− BUILD: "stack"
11 RESOLVER: "lts-10.0"
3 RESOLVER: "lts-10.0"
12 GHC_OPTIONS: "-O0 -Werror"
4 GHC_OPTIONS: "-O0 -Werror"
13− STACK_UPGRADE: "y"
5+ PACKCHECK: ./packcheck.sh
14−# STACK_OPTIONS: "-v"
6+ # The commit id of packcheck.sh to use from harendra-kumar/packcheck on github
7+ PACKCHECK_COMMIT: "c028c2425a372487e74157569d0a6cd4d745575d"
8+
9+ # ------------------------------------------------------------------------
10+ # Normally you do not need to customize hereafter
11+ # ------------------------------------------------------------------------
15
12
16 STACK_ROOT: "c:\\sr"
13 STACK_ROOT: "c:\\sr"
17 LOCAL_BIN: "%APPDATA%\\local\\bin"
14 LOCAL_BIN: "%APPDATA%\\local\\bin"
18 PATH: "%PATH%;%APPDATA%\\local\\bin"
15 PATH: "%PATH%;%APPDATA%\\local\\bin"
19 CABAL_REINIT_CONFIG: "y"
16 CABAL_REINIT_CONFIG: "y"
20 TEST_INSTALL: "y"
17 TEST_INSTALL: "y"
21− PACKAGE_TEST_VER: "1a4de26422ee296f0811e032bec922123f019963"
22
18
23cache:
19cache:
24− - "%STACK_ROOT%" # stack root
20+ - "%STACK_ROOT%"
25− # ghc & msys - cache restore takes almost same time as reinstall
26− # - "%LOCALAPPDATA%\\Programs\\stack"
27 - "%LOCAL_BIN%"
21 - "%LOCAL_BIN%"
28 - "%APPDATA%\\cabal"
22 - "%APPDATA%\\cabal"
29 - "%APPDATA%\\ghc"
23 - "%APPDATA%\\ghc"
24+# - "%LOCALAPPDATA%\\Programs\\stack"
30
25
26+clone_folder: "c:\\pkg"
31build: off
27build: off
32
28
33before_test:
29before_test:
30+- if not exist %PACKCHECK% curl -sSkL -o%PACKCHECK% https://raw.githubusercontent.com/harendra-kumar/packcheck/%PACKCHECK_COMMIT%/packcheck.sh
34- if not exist %LOCAL_BIN% mkdir %LOCAL_BIN%
31- if not exist %LOCAL_BIN% mkdir %LOCAL_BIN%
35- where stack.exe || curl -sSkL -ostack.zip http://www.stackage.org/stack/windows-x86_64 && 7z x stack.zip stack.exe && move stack.exe %LOCAL_BIN%
32- where stack.exe || curl -sSkL -ostack.zip http://www.stackage.org/stack/windows-x86_64 && 7z x stack.zip stack.exe && move stack.exe %LOCAL_BIN%
33+- stack upgrade
36- stack --version
34- stack --version
37−- curl -sSkL -opackage-test.sh https://raw.githubusercontent.com/harendra-kumar/package-test/%PACKAGE_TEST_VER%/package-test.sh
38
35
39test_script:
36test_script:
40- stack setup > nul
37- stack setup > nul
41−- chcp 65001 && stack exec bash package-test.sh
38+- chcp 65001 && stack exec bash -- -c "chmod +x %PACKCHECK%; %PACKCHECK% stack"