circle.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. machine:
  2. services:
  3. - docker
  4. dependencies:
  5. cache_directories:
  6. - "~/.ethash" # Cache the ethash DAG generated by hive for consecutive builds
  7. - "~/.docker" # Cache all docker images manually to avoid lengthy rebuilds
  8. override:
  9. # Restore all previously cached docker images
  10. - mkdir -p ~/.docker
  11. - for img in `ls ~/.docker`; do docker load -i ~/.docker/$img; done
  12. # Pull in and hive, restore cached ethash DAGs and do a dry run
  13. - go get -u github.com/karalabe/hive
  14. - (cd ~/.go_workspace/src/github.com/karalabe/hive && mkdir -p workspace/ethash/ ~/.ethash)
  15. - (cd ~/.go_workspace/src/github.com/karalabe/hive && cp -r ~/.ethash/. workspace/ethash/)
  16. - (cd ~/.go_workspace/src/github.com/karalabe/hive && hive --docker-noshell --client=NONE --test=. --sim=. --loglevel=6)
  17. # Cache all the docker images and the ethash DAGs
  18. - for img in `docker images | grep -v "^<none>" | tail -n +2 | awk '{print $1}'`; do docker save $img > ~/.docker/`echo $img | tr '/' ':'`.tar; done
  19. - cp -r ~/.go_workspace/src/github.com/karalabe/hive/workspace/ethash/. ~/.ethash
  20. test:
  21. override:
  22. # Build Geth and move into a known folder
  23. - make geth
  24. - cp ./build/bin/geth $HOME/geth
  25. # Run hive and move all generated logs into the public artifacts folder
  26. - (cd ~/.go_workspace/src/github.com/karalabe/hive && hive --docker-noshell --client=go-ethereum:local --override=$HOME/geth --test=. --sim=.)
  27. - cp -r ~/.go_workspace/src/github.com/karalabe/hive/workspace/logs/* $CIRCLE_ARTIFACTS