on master help sign in
Add circleci for coveralls
commit16ebabe9161fef29a9f2caae81b8e37053ddce45 authorHarendra Kumar <harendra.kumar@gmail.com> dateSun 12 Aug 2018, 06:40 (8 years ago) parentc39a442
1 file changed+135
.circleci/config.yml+135
.circleci/config.ymlnew file+135
@@ -0,0 +1,135 @@
1+version: 2
2+
3+#-----------------------------------------------------------------------------
4+# packcheck-0.3.1
5+# Packcheck global environment variables
6+#-----------------------------------------------------------------------------
7+
8+env: &env
9+ environment:
10+ # ------------------------------------------------------------------------
11+ # Common options
12+ # ------------------------------------------------------------------------
13+ # GHC_OPTIONS: "-Werror"
14+ CABAL_REINIT_CONFIG: "y"
15+ LC_ALL: "C.UTF-8"
16+
17+ # ------------------------------------------------------------------------
18+ # What to build
19+ # ------------------------------------------------------------------------
20+ # DISABLE_TEST: "y"
21+ DISABLE_BENCH: "y"
22+ DISABLE_DOCS: "y"
23+ DISABLE_SDIST_BUILD: "y"
24+ DISABLE_DIST_CHECKS: "y"
25+ # ENABLE_INSTALL: "y"
26+
27+ # ------------------------------------------------------------------------
28+ # stack options
29+ # ------------------------------------------------------------------------
30+ # Note requiring a specific version of stack using STACKVER may fail due to
31+ # github API limit while checking and upgrading/downgrading to the specific
32+ # version.
33+ #STACKVER: "1.6.5"
34+ #STACK_UPGRADE: "y"
35+ #RESOLVER: "lts-12"
36+
37+ # ------------------------------------------------------------------------
38+ # cabal options
39+ # ------------------------------------------------------------------------
40+ CABAL_CHECK_RELAX: "y"
41+ CABAL_NO_SANDBOX: "y"
42+ CABAL_HACKAGE_MIRROR: "hackage.haskell.org:http://hackage.fpcomplete.com"
43+
44+ # ------------------------------------------------------------------------
45+ # Where to find the required tools
46+ # ------------------------------------------------------------------------
47+ #PATH: /bin:/usr/bin
48+ #TOOLS_DIR: /opt
49+
50+ # ------------------------------------------------------------------------
51+ # Location of packcheck.sh (the shell script invoked to perform CI tests ).
52+ # ------------------------------------------------------------------------
53+ # You can either commit the packcheck.sh script at this path in your repo or
54+ # you can use it by specifying the PACKCHECK_REPO_URL option below in which
55+ # case it will be automatically copied from the packcheck repo to this path
56+ # during CI tests. In any case it is finally invoked from this path.
57+ PACKCHECK_LOCAL_PATH: "./packcheck.sh"
58+ # If you have not committed packcheck.sh in your repo at PACKCHECK_LOCAL_PATH
59+ # then it is automatically pulled from this URL.
60+ PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/harendra-kumar/packcheck"
61+ PACKCHECK_GITHUB_COMMIT: "432621414fe9b59a29425c77d3754a671afffc95"
62+ PACKCHECK_CMD: "$PACKCHECK_LOCAL_PATH $BUILD PATH=/opt/ghc/bin:$PATH"
63+
64+ docker:
65+ - image: debian:stretch
66+
67+#-----------------------------------------------------------------------------
68+# Common utility stuff, not to be modified usually
69+#-----------------------------------------------------------------------------
70+
71+preinstall: &preinstall
72+ run: |
73+ echo "deb http://downloads.haskell.org/debian stretch main" >> /etc/apt/sources.list
74+ apt-get update
75+ apt-get install -y curl
76+ # required for apt-key
77+ apt-get install -y gnupg
78+ # required for cache save and restore
79+ apt-get install -y ca-certificates
80+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574
81+ apt-get update
82+
83+ # If a custom stack-yaml is specified, replace the default with that
84+ if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
85+ unset STACK_YAML
86+
87+ # Get packcheck if needed
88+ CURL=$(which curl)
89+ PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
90+ if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
91+ chmod +x $PACKCHECK_LOCAL_PATH
92+
93+restore: &restore
94+ # Needs to happen after installing ca-certificates
95+ restore_cache:
96+ key: v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
97+
98+save: &save
99+ save_cache:
100+ key: v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
101+ paths:
102+ - ~/.cabal
103+ - ~/.ghc
104+ - ~/.local
105+ - ~/.stack
106+
107+#-----------------------------------------------------------------------------
108+# Build matrix
109+#-----------------------------------------------------------------------------
110+
111+jobs:
112+ coveralls:
113+ <<: *env
114+ steps:
115+ - checkout
116+ - *preinstall
117+ - *restore
118+ - run:
119+ environment:
120+ BUILD: cabal
121+ COVERALLS_OPTIONS: "--repo-token=KlGN45lDWQkw55TNm18nkam2EXRg9lCSH --coverage-mode=StrictlyFullLines --exclude-dir=test test"
122+ command: |
123+ apt-get install -y ghc-8.2.2
124+ apt-get install -y cabal-install-2.2
125+ # required by hpc-coveralls
126+ apt-get install -y libcurl4-gnutls-dev
127+ apt-get install -y git
128+ bash -c "$PACKCHECK_CMD"
129+ - *save
130+
131+workflows:
132+ version: 2
133+ build:
134+ jobs:
135+ - coveralls