config.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #
  2. # TODO: compilation
  3. # TODO: store_artifacts
  4. # TODO: name commands properly
  5. # TODO: mac job
  6. # TODO: improve caching
  7. # TODO: fix `xvfb gulp test` command
  8. # TODO: windows job
  9. # TODO: store_test_results
  10. # TODO: docker images
  11. #
  12. defaults: &defaults
  13. working_directory: /home/circleci/mist
  14. docker:
  15. - image: circleci/node:8.9.4-browsers
  16. environment:
  17. # Setting variable to fix node-gyp build error:
  18. # https://github.com/nodejs/node/issues/7173#issuecomment-224772258
  19. - CXX_host: 'g++ -m32'
  20. linux_dependencies: &linux_dependencies
  21. name: Linux package dependencies
  22. # Installing multilib (build for 32 and 64 architectures):
  23. # https://www.quora.com/How-do-I-fix-fatal-error-sys-cdefs-h-file-not-found-include-sys-cdefs-h
  24. command: |
  25. sudo apt-get update &&
  26. sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib icnsutils xz-utils &&
  27. sudo apt-get install graphicsmagick
  28. install_meteor: &install_meteor
  29. name: Installing Meteor
  30. # PATH=$PATH:$HOME/.meteor && curl -L https://raw.githubusercontent.com/arunoda/travis-ci-meteor-packages/1390e0f96162d0d70fc1e60a6b0f4f891a0e8f42/configure.sh | /bin/sh
  31. command: which meteor || curl https://install.meteor.com | /bin/sh
  32. install_node_modules: &install_node_modules
  33. name: Installing node dependencies using yarn
  34. command: yarn
  35. # Javascript Node CircleCI 2.0 configuration file
  36. #
  37. # Check https://circleci.com/docs/2.0/language-javascript/ for more details
  38. #
  39. version: 2
  40. jobs:
  41. build:
  42. <<: *defaults
  43. steps:
  44. - checkout
  45. # Download and cache dependencies
  46. - restore_cache:
  47. keys:
  48. - v1-dependencies-{{ checksum "package.json" }}
  49. # fallback to using the latest cache if no exact match is found
  50. - v1-dependencies-
  51. # Setting PATH: https://circleci.com/docs/2.0/env-vars/#setting-path
  52. - run: echo 'export PATH=`yarn global bin`:$PATH' >> $BASH_ENV
  53. - run:
  54. <<: *linux_dependencies
  55. - run:
  56. <<: *install_meteor
  57. - run:
  58. <<: *install_node_modules
  59. - save_cache:
  60. paths:
  61. - node_modules
  62. key: v1-dependencies-{{ checksum "package.json" }}
  63. - persist_to_workspace:
  64. root: /home/circleci/
  65. paths:
  66. - mist
  67. mist-linux:
  68. <<: *defaults
  69. steps:
  70. - attach_workspace:
  71. at: /home/circleci/
  72. - run:
  73. <<: *linux_dependencies
  74. - run:
  75. <<: *install_meteor
  76. - run:
  77. <<: *install_node_modules
  78. - run: yarn build:mist --linux
  79. - store_artifacts:
  80. path: dist_mist/release
  81. wallet-linux:
  82. <<: *defaults
  83. steps:
  84. - attach_workspace:
  85. at: /home/circleci/
  86. - run:
  87. <<: *linux_dependencies
  88. - run:
  89. <<: *install_meteor
  90. - run:
  91. <<: *install_node_modules
  92. - run: yarn build:wallet --linux
  93. - store_artifacts:
  94. path: dist_wallet/release
  95. spectron-test:
  96. docker:
  97. - image: circleci/node:8.9.4
  98. steps:
  99. - attach_workspace:
  100. at: /home/circleci/
  101. - run: xvfb-run yarn test:e2e
  102. unit-test:
  103. <<: *defaults
  104. steps:
  105. - attach_workspace:
  106. at: /home/circleci/
  107. - run: << *install_node_modules
  108. - run: yarn test:unit:once
  109. workflows:
  110. version: 2
  111. build_and_test:
  112. jobs:
  113. - build
  114. - mist-linux:
  115. requires:
  116. - build
  117. - wallet-linux:
  118. requires:
  119. - build
  120. - unit-test:
  121. requires:
  122. - build