Skip to content

Commit

Permalink
Merge branch 'master' into nix-derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfmpe committed Mar 27, 2020
2 parents 7e26dc9 + 69583e3 commit 1148631
Show file tree
Hide file tree
Showing 258 changed files with 15,738 additions and 2,485 deletions.
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*/docker-compose*
*/test*
**/.stack-work
**/.stack
**/stack.yaml.lock
**/.git
hs-abci-examples/nameservice/conf.d
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.stack-work/
*.cabal
*~
.ci-bins/
*.dump-hi

# nix
result-*
result-*
1 change: 1 addition & 0 deletions .stylish_haskell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,4 @@ language_extensions:
- ExistentialQuantification
- FunctionalDependencies
- ViewPatterns
- PackageImports
89 changes: 80 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ ghc:
- "8.6.1"
cabal: "2.4"
sudo: required

services:
- docker

# Cache .stack for build_times--
addons:
apt:
sources:
- sourceline: 'ppa:tah83/secp256k1'
packages:
- libsecp256k1-dev

cache:
directories:
- $HOME/.stack

before_install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
Expand All @@ -19,15 +31,74 @@ before_install:
- rm protoc-release.zip
install:
- travis_wait 120 stack --skip-ghc-check setup
- travis_wait 120 stack --skip-ghc-check install hlint-2.1.26 stylish-haskell-0.9.4.3
script:
- make hlint

# When branch is `master` we run `haskell-stylish` and fail if git working directory becomes dirty
- if [ "$TRAVIS_BRANCH" == "master" ]; then make stylish && git diff-index --quiet HEAD; fi
jobs:
include:

- stage: Cleanliness is next to Godliness
name: "Ensure that code matches style guidelines for PRs to master"
# When branch is `master` we run `haskell-stylish` and fail if git working directory becomes dirty
if: branch = master
script:
- echo "test formatting"
- travis_wait 120 stack --skip-ghc-check install hlint-2.1.26 stylish-haskell-0.9.4.3 weeder-1.0.8
- make stylish && git diff-index --quiet HEAD
- make hlint
- make weeder

- echo "test tutorial"
- travis_wait 120 stack --skip-ghc-check install markdown-unlit-0.5.0
- make test-tutorial

- stage: Core Tests
name: "Test Core and Client Libraries"
script:
- echo "Test libraries"
# this image is needed for the sdk IAVLSpec
- docker run --name iavl -p 8090:8090 -p 8091:8091 -d foamspace/iavl:latest /iavlserver -db-name "test" -datadir "." -grpc-endpoint "0.0.0.0:8090" -gateway-endpoint "0.0.0.0:8091"
- make test-libraries
- docker rm -f iavl
- echo "Test Libraries with Nix"
- echo "This stage is currently disabled as Nix doesn't seem to play well with libsecp256k1"

- echo "Test IAVL Client"
- docker run --name iavl -p 8090:8090 -p 8091:8091 -d foamspace/iavl:latest /iavlserver -db-name "test" -datadir "." -grpc-endpoint "0.0.0.0:8090" -gateway-endpoint "0.0.0.0:8091"
- make test-iavl-client
- docker rm -f iavl

- echo "Test Tendermint Client"
- docker-compose -f hs-tendermint-client/docker-compose.yaml -p test-hs-tendermint-client up -d
- make test-kv-store
- docker-compose -f hs-tendermint-client/docker-compose.yaml -p test-hs-tendermint-client down -v --rmi local

- echo "Test simple-storage"
- make docker-test-prebake
- docker-compose -f hs-abci-docs/simple-storage/docker-compose.yaml -p test-hs-abci-examples-simple-storage-e2e up -d
- make test-simple-storage
- docker-compose -f hs-abci-docs/simple-storage/docker-compose.yaml -p test-hs-abci-examples-simple-storage-e2e down -v --rmi local

- make test-libraries
- echo "Test nameservice"
- make docker-test-prebake
- docker-compose -f hs-abci-docs/nameservice/docker-compose-test.yaml -p test-hs-abci-examples-nameservice-e2e up -d
- make test-nameservice
- docker-compose -f hs-abci-docs/nameservice/docker-compose-test.yaml -p test-hs-abci-examples-nameservice-e2e down -v --rmi local

- curl https://nixos.org/nix/install | sh
- . $HOME/.nix-profile/etc/profile.d/nix.sh
- stack --nix test hs-abci-types hs-abci-server hs-abci-sdk
- stage: publish website
script:
- echo "building website"
- travis_wait 120 stack --skip-ghc-check install tintin
- make build-site
- make build-docs-local
- mkdir -p ./hs-abci-docs/.stack-work/tintin/rendered/haddocks
- find ./ -type f -name "index.html" | grep -v tintin | sed 's/index.html//g' | xargs -I {} cp -r {} hs-abci-docs/.stack-work/tintin/rendered/haddocks/
- echo "kepler.dev" > ./hs-abci-docs/.stack-work/tintin/rendered/CNAME
deploy:
provider: pages
local-dir: ./hs-abci-docs/.stack-work/tintin/rendered
email: deploy@travis-ci.org
name: Deployment Bot
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
on:
branch: master
136 changes: 136 additions & 0 deletions .weeder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
- package:
- name: hs-abci-server
- section:
- name: test:hs-abci-server-test
- message:
- name: Redundant build-depends entry
- depends: hspec-discover

- package:
- name: hs-abci-types
- section:
- name: library
- message:
- name: Missing other-modules entry
- module:
- Proto.Types
- Proto.Types_Fields
- Proto.Vendored.Google.Protobuf.Timestamp
- Proto.Vendored.Google.Protobuf.Timestamp_Fields
- Proto.Vendored.Tendermint.Tendermint.Crypto.Merkle.Merkle
- Proto.Vendored.Tendermint.Tendermint.Crypto.Merkle.Merkle_Fields
- Proto.Vendored.Tendermint.Tendermint.Libs.Common.Types
- Proto.Vendored.Tendermint.Tendermint.Libs.Common.Types_Fields
- message:
- name: Module not compiled
- module:
- Proto.Types
- Proto.Types_Fields
- Proto.Vendored.Gogo.Protobuf.Gogoproto.Gogo
- Proto.Vendored.Gogo.Protobuf.Gogoproto.Gogo_Fields
- Proto.Vendored.Google.Protobuf.Timestamp
- Proto.Vendored.Google.Protobuf.Timestamp_Fields
- Proto.Vendored.Tendermint.Tendermint.Crypto.Merkle.Merkle
- Proto.Vendored.Tendermint.Tendermint.Crypto.Merkle.Merkle_Fields
- Proto.Vendored.Tendermint.Tendermint.Libs.Common.Types
- Proto.Vendored.Tendermint.Tendermint.Libs.Common.Types_Fields
- message:
- name: Redundant build-depends entry
- depends: proto-lens-runtime
- section:
- name: test:hs-abci-types-test
- message:
- name: Redundant build-depends entry
- depends: hspec-discover

- package:
- name: hs-iavl-client
- section:
- name: test:hs-iavl-client-test
- message:
- name: Redundant build-depends entry
- depends: hspec-discover
- section:
- name: library
- message:
- name: Missing other-modules entry
- module:
- Proto.Google.Protobuf.Empty
- Proto.Iavl.Api
- message:
- name: Module not compiled
- module:
- Proto.Google.Api.Annotations
- Proto.Google.Api.Http
- Proto.Google.Protobuf.Empty
- Proto.Iavl.Api
- Proto.Iavl.Api_Fields
- message:
- name: Redundant build-depends entry
- depends: proto-lens-runtime

- package:
- name: hs-abci-sdk
- section:
- name: library
- message:
- name: Missing other-modules entry
- module:
- Proto.Modules.Auth
- Proto.Modules.Auth_Fields
- Proto.Modules.Bank
- Proto.Modules.Bank_Fields
- Proto.Types.Transaction
- Proto.Types.Transaction_Fields
- message:
- name: Module not compiled
- module:
- Proto.Modules.Auth
- Proto.Modules.Auth_Fields
- Proto.Modules.Bank
- Proto.Modules.Bank_Fields
- Proto.Types.Transaction
- Proto.Types.Transaction_Fields
- message:
- name: Redundant build-depends entry
- depends:
- polysemy-plugin
- proto-lens-runtime
- section:
- name: test:hs-abci-sdk-test
- message:
- name: Redundant build-depends entry
- depends:
- hspec-discover
- polysemy-plugin

- package:
- name: simple-storage
- section:
- name: library
- message:
- name: Missing other-modules entry
- module:
- Proto.SimpleStorage.Messages
- Proto.SimpleStorage.Messages_Fields
- message:
- name: Module not compiled
- module:
- Proto.SimpleStorage.Messages
- Proto.SimpleStorage.Messages_Fields
- message:
- name: Redundant build-depends entry
- depends:
- polysemy-plugin
- proto-lens-runtime


- package:
- name: nameservice
- section:
- name: library
- message:
- name: Redundant build-depends entry
- depends: polysemy-plugin
- section:
- name: test:tutorial
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM haskell:8

RUN apt-get update && apt-get install --assume-yes protobuf-compiler libsecp256k1-dev

COPY stack.yaml /tmp/stack.resolver-dummy.yaml
RUN stack --resolver `cat /tmp/stack.resolver-dummy.yaml | grep resolver | sed 's/resolver://'` setup && stack exec -- ghc --version

# Install GHC.
WORKDIR /project
COPY . /project

# Install project to /usr/local/bin
RUN stack build --copy-bins --local-bin-path /usr/local/bin

8 changes: 8 additions & 0 deletions Dockerfile.prebake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This creates the same image as the regular Dockerfile, but assumes that the binaries
# were compiled into a .ci-bins/ folder in the same directory as this one. This is
# substantially faster than building inside Docker, but only works on Linux systems.
FROM haskell:8

RUN apt-get update && apt-get install --assume-yes protobuf-compiler libsecp256k1-dev

COPY .ci-bins/* /usr/local/bin/
1 change: 1 addition & 0 deletions INSTALL.md
Loading

0 comments on commit 1148631

Please sign in to comment.