From 912e262a816ac1ee6d6ccbc633890d2231c25732 Mon Sep 17 00:00:00 2001
From: KtorZ
Date: Mon, 4 Mar 2019 12:15:07 +0100
Subject: [PATCH 1/4] Add support for Coveralls and Stylish-Haskell to the CI
---
.travis.yml | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 0b4721c3e78..56ff1d414d5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,7 @@ language: generic
cache:
directories:
- $HOME/.stack
+ - $HOME/.ghc
# Ensure necessary system libraries are present:
addons:
@@ -29,19 +30,29 @@ before_install:
# Download and unpack the stack executable:
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
+- export LTS=$(cat stack.yaml | grep resolver) # Extract the LTS from the stack.yaml
- travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
install:
+- curl -sSL https://raw.github.com/jaspervdj/stylish-haskell/master/scripts/latest.sh | sh -s $(find . -type f -name "*.hs" ! -path "*.stack-work*") -i
+- git diff --exit-code # Exit if Stylish-Haskell yields any diff
- stack --no-terminal setup
+- stack --no-terminal build --only-snapshot
- stack --no-terminal build --only-dependencies
-- stack --no-terminal build --test --no-run-tests
-- stack --no-terminal test
+- stack --no-terminal build --test --no-run-tests --coverage
+- stack --no-terminal test --coverage
- curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s .
- curl -sSL https://raw.github.com/ndmitchell/weeder/master/misc/travis.sh | sh -s .
- stack --no-terminal install
- sha256sum $EXECUTABLE | head -c 64 > $EXECUTABLE_CHECKSUM
- ls $EXECUTABLE
- ls $EXECUTABLE_CHECKSUM
+# Installing shc for coverage reporting;
+# We trick it a bit to use the same LTS as us and leverage already installed LTS
+# to speed up the process.
+- git clone https://github.com/rubik/stack-hpc-coveralls && cd stack-hpc-coveralls && git checkout 3d8352d5642ab214a7a574bd797880ae39595a44 && echo $LTS > stack.yaml
+- stack --no-terminal install
+- cd - && shc cardano-wallet unit
deploy:
provider: releases
From 36a34f06d83649c1dca731c27b0ecfca635e0341 Mon Sep 17 00:00:00 2001
From: KtorZ
Date: Mon, 4 Mar 2019 12:18:53 +0100
Subject: [PATCH 2/4] remove redundant dependencies from .cabal
---
cardano-wallet.cabal | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/cardano-wallet.cabal b/cardano-wallet.cabal
index 556e9e27d15..0e080095925 100644
--- a/cardano-wallet.cabal
+++ b/cardano-wallet.cabal
@@ -28,28 +28,6 @@ library
build-depends:
base
- -- Hackage Dependencies
- , aeson
- , aeson-pretty
- , base16-bytestring
- , base58-bytestring
- , bytestring
- , cborg
- , containers
- , cryptonite
- , deepseq
- , digest
- , generic-lens
- , http-client
- , memory
- , microlens
- , text
- , time
- , transformers
-
- -- Other Project Dependencies
- , cardano-crypto
-
hs-source-dirs:
src
exposed-modules:
@@ -92,7 +70,6 @@ test-suite unit
build-depends:
base
- , cardano-wallet
type:
exitcode-stdio-1.0
hs-source-dirs:
From 57d6f507fe4cc74ac036ba4cb747149ad05cd7a3 Mon Sep 17 00:00:00 2001
From: KtorZ
Date: Mon, 4 Mar 2019 12:19:13 +0100
Subject: [PATCH 3/4] only trigger CI for build on and against master
---
.travis.yml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index 56ff1d414d5..d5fc11217d8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,6 +14,11 @@ env:
# Do not choose a language; we provide our own build tools:
language: generic
+# Deactivate builds on branches but `master` (CI is still triggered by PRs)
+branches:
+ only:
+ - master
+
# Caching so the next build will be fast too:
cache:
directories:
From 2a614313b6968d1ceff37bef995cb5b8912354e1 Mon Sep 17 00:00:00 2001
From: KtorZ
Date: Mon, 4 Mar 2019 13:54:52 +0100
Subject: [PATCH 4/4] Adjust README to add coveralls badge and remove version
number
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c8032dcfc0d..e04a88b9307 100644
--- a/README.md
+++ b/README.md
@@ -7,8 +7,9 @@
-
+
+