You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.travis.yml 6.4KB

  1. # errata:
  2. # - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback]
  3. # IPv6 support
  4. sudo: required
  5. dist: trusty
  6. os: linux
  7. language: generic
  8. services:
  9. - docker
  10. cache:
  11. ccache: true
  12. directories:
  13. - $HOME/cache
  14. env:
  15. global:
  16. # DOCKER_HUB_USER
  17. - secure: "J0T+zrRBBzBnxoioCD378cRSJUF8Vms32QMmrENVVfuJl03oBQv0QxSatLEiD4PtRPrN00mJ8/k/HdqFQ0SN1yg6a00duOZ6C9jk6t/fExBO1LNhp3Z7lcaMUrNEyRN6sgfVeznDVTGj9jBQU2HNlwHk0UD9BNp/k+Bjhrtw7Njp9JTLZKBgxrXk0WZmfk0d75Q+9DajA1j2tSfWVpwzv6HMGfqIH1wsVEakBY+tnaE6EO3IdzdWHhf/iV+Tx0tL0Qz/6mejgSuoGLTJLmeTrceTTmsDlN3B95y+XfcYDs6EP7gpzN8Ffg/mLV8xJ2Myj7+b1o+smMJZE5tLuPIeAu0YsfkPNa/tNLotOlDxF72per0kXyNYbRf+JrpxiOu9pLCtdtd40V2SsiNhpQqHVy+b+wkkqo2syTHT+9UNkqEi3WFm6TqFuOeQNtDm6R0hRl/Talw/ZEeKs68z1Cf6VyBrZG5LqtOurtWlKwXCe/Tr1i2g4BEAcbywphtCCcfgMK9YSGQnjKkGk6k9gVEa2bneYLZz1RSh2OpXnIsIJOX7X0hNd5xtQDLgbpSUlKwVcEriWeGe12GCszKNX9gdEo2bHeq4xAJ6BE+ot745z9dc+nC2BJ6Su+I5L6zBg4m2FWn0TWhPvz/6JR26t6ls/E7m+hkwJTCHnIUiFmmzpEw="
  18. # DOCKER_HUB_PASSWORD
  19. - secure: "RLzlMhfLqwSBrZqJOVOd61suXBn+HtUR3vOZfuFYF/Qmjjj5TE41+rObZmzc54hP/ZL+OH6blnibpvfDXlX+eN38ivFQfuxkJIGL68SJsEwNBRwW39Yw6Hl5RdI41MLCH7ByN15wifLp1JKBilHJ7XGMOUjI7P0yl7JjX8GBXUCtJbVLRugo80/yn+XQ1NdnlpbpYHNjMEQFWSODPa3pSK5McWvyQjDZDgS+IkdrZmIYJPMa7bmKH5I/edUPSmXQT905FgEwq9u8XR0SyBopli21EK9l6GkXIIvmDTYz5vT26Apvi2B4Aoazlklg+KNRUJuLGerpt6kbnU0gMSUChVkFfFhOk6GRSN3a/AUfD2FOudvMhet2QvlPHx+GYdEUr5XVo5HW42pHsqfD6eDtHd8VLTsHP0q4C8V85fNMv21lkkehy2ry8fx/RRy6x4O2wg2mua+79UkGKXp75gMKzWEcth34PCFCOu37l2F8R/ANnrQ52K/8vIQ88TtU2OpYX89fHjLojBxu+WKEBGZH2LRPsZBOUHeeO5C/xKDrhZU24ORnMW8wg66Qg5GIX1KI4a8yp73Mpues5hzpJ6wkMuRrQt40ymKndLCjv8KSd+5BfP6Or/KIrzDNYdZaasjk7JNi6rcZmm9d3fTAo+Ja/mjpUCIOo3SX14luzVCJIig="
  20. - DOCKER_BUILD=false
  21. stages:
  22. - build depends
  23. - build src
  24. - run tests
  25. - build docker
  26. builddepends: &builddepends
  27. stage: build depends
  28. script:
  29. - $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh
  30. buildsrc: &buildsrc
  31. stage: build src
  32. script:
  33. - $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh
  34. - $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh
  35. runtests: &runtests
  36. stage: run tests
  37. script:
  38. - $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh
  39. - $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh
  40. - $DOCKER_RUN_IN_BUILDER ./ci/test_unittests.sh
  41. - $DOCKER_RUN_IN_BUILDER ./ci/test_integrationtests.sh --jobs=3
  42. builddocker: &builddocker
  43. stage: build docker
  44. script:
  45. # no need to run tests again here
  46. - if [ "$DOCKER_BUILD" = "true" ]; then $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh && $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh && BUILD_DIR=build-ci/ruxcryptocore-$BUILD_TARGET ./docker/build-docker.sh; fi
  47. jobs:
  48. include:
  49. # build depends
  50. - <<: *builddepends
  51. env: BUILD_TARGET=arm-linux
  52. - <<: *builddepends
  53. env: BUILD_TARGET=win32
  54. - <<: *builddepends
  55. env: BUILD_TARGET=win64
  56. - <<: *builddepends
  57. env: BUILD_TARGET=linux32
  58. - <<: *builddepends
  59. env: BUILD_TARGET=linux64
  60. - <<: *builddepends
  61. env: BUILD_TARGET=linux64_nowallet
  62. - <<: *builddepends
  63. env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
  64. - <<: *builddepends
  65. env: BUILD_TARGET=mac
  66. # build source
  67. - <<: *buildsrc
  68. env: BUILD_TARGET=arm-linux
  69. - <<: *buildsrc
  70. env: BUILD_TARGET=win32
  71. - <<: *buildsrc
  72. env: BUILD_TARGET=win64
  73. - <<: *buildsrc
  74. env: BUILD_TARGET=linux32
  75. - <<: *buildsrc
  76. env: BUILD_TARGET=linux64
  77. - <<: *buildsrc
  78. env: BUILD_TARGET=linux64_nowallet
  79. - <<: *buildsrc
  80. env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
  81. - <<: *buildsrc
  82. env: BUILD_TARGET=mac
  83. # run tests (no tests for arm-linux and mac)
  84. - <<: *runtests
  85. env: BUILD_TARGET=win32
  86. - <<: *runtests
  87. env: BUILD_TARGET=win64
  88. - <<: *runtests
  89. env: BUILD_TARGET=linux32
  90. - <<: *runtests
  91. env: BUILD_TARGET=linux64
  92. - <<: *runtests
  93. env: BUILD_TARGET=linux64_nowallet
  94. - <<: *runtests
  95. env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
  96. # build docker
  97. - <<: *builddocker
  98. env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
  99. before_cache:
  100. # Save builder image
  101. - docker save ruxcrypto-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q ruxcrypto-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/ruxcrypto-builder-$BUILD_TARGET.tar.gz
  102. before_install:
  103. - travis_retry travis_apt_get_update
  104. - travis_retry sudo apt-get -yq --no-install-suggests --no-install-recommends install docker-ce realpath
  105. install:
  106. # Our scripts try to be Travis agnostic
  107. - export PULL_REQUEST="$TRAVIS_PULL_REQUEST"
  108. - export JOB_NUMBER="$TRAVIS_JOB_NUMBER"
  109. - export HOST_SRC_DIR=$TRAVIS_BUILD_DIR
  110. - export HOST_CACHE_DIR=$HOME/cache
  111. - export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
  112. - source ./ci/matrix.sh
  113. - mkdir -p $HOST_CACHE_DIR/docker && mkdir -p $HOST_CACHE_DIR/ccache && mkdir -p $HOST_CACHE_DIR/depends && mkdir -p $HOST_CACHE_DIR/sdk-sources
  114. # Keep this as it makes caching related debugging easier
  115. - ls -lah $HOST_CACHE_DIR && ls -lah $HOST_CACHE_DIR/depends && ls -lah $HOST_CACHE_DIR/ccache && ls -lah $HOST_CACHE_DIR/docker
  116. # Load cached builder image
  117. - if [ -f $HOST_CACHE_DIR/docker/ruxcrypto-builder-$BUILD_TARGET.tar.gz ]; then zcat $HOST_CACHE_DIR/docker/ruxcrypto-builder-$BUILD_TARGET.tar.gz | docker load || true; fi
  118. - travis_retry docker pull ubuntu:bionic
  119. - travis_retry docker build -t $BUILDER_IMAGE_NAME --build-arg=USER_ID=$UID --build-arg=GROUP_ID=$UID --build-arg=BUILD_TARGET=$BUILD_TARGET -f ci/Dockerfile.builder ci
  120. before_script:
  121. # Make sure stdout is in blocking mode. Otherwise builds will fail due to large writes to stdout
  122. # See https://github.com/travis-ci/travis-ci/issues/4704. If this gets fixed, this line can also be removed.
  123. - python3 -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
  124. # Build docker image only for develop branch of the main repo
  125. - if [ "$TRAVIS_REPO_SLUG" != "ruxcryptopay/ruxcrypto" -o "$TRAVIS_BRANCH" != "develop" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then export DOCKER_BUILD="false"; echo DOCKER_BUILD=$DOCKER_BUILD; fi
  126. after_script:
  127. - echo $TRAVIS_COMMIT_RANGE
  128. - echo $TRAVIS_COMMIT_LOG
  129. after_success:
  130. - if [ "$DOCKER_BUILD" = "true" ]; then docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD && ./docker/push-docker.sh; fi