.travis.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. language: go
  18. dist: bionic
  19. _addons: &addon_conf
  20. apt:
  21. sources:
  22. - ubuntu-toolchain-r-test
  23. packages:
  24. - gcc-multilib
  25. - gcc-7-multilib
  26. - g++-multilib
  27. go:
  28. - "1.16"
  29. git:
  30. depth: false
  31. matrix:
  32. allow_failures:
  33. - env:
  34. - TEST=BUILD_PORTS
  35. - VM_AMOUNT=1
  36. - TARGET_SET=1
  37. include:
  38. # Style checking
  39. - os: linux
  40. language: python
  41. python:
  42. - "3.5"
  43. addons:
  44. apt:
  45. packages:
  46. - "python3-pip"
  47. env:
  48. - TEST=STYLE
  49. - DEBUG=1
  50. # newt build <targets>
  51. - os: linux
  52. addons: *addon_conf
  53. env:
  54. - TEST=BUILD_TARGETS
  55. - VM_AMOUNT=4
  56. - TARGET_SET=1
  57. - os: linux
  58. addons: *addon_conf
  59. env:
  60. - TEST=BUILD_TARGETS
  61. - VM_AMOUNT=4
  62. - TARGET_SET=2
  63. - os: linux
  64. addons: *addon_conf
  65. env:
  66. - TEST=BUILD_TARGETS
  67. - VM_AMOUNT=4
  68. - TARGET_SET=3
  69. - os: linux
  70. addons: *addon_conf
  71. env:
  72. - TEST=BUILD_TARGETS
  73. - VM_AMOUNT=4
  74. - TARGET_SET=4
  75. # newt test all (Linux)
  76. - os: linux
  77. addons: *addon_conf
  78. env:
  79. - TEST=TEST_ALL
  80. - VM_AMOUNT=2
  81. - TARGET_SET=1
  82. - os: linux
  83. addons: *addon_conf
  84. env:
  85. - TEST=TEST_ALL
  86. - VM_AMOUNT=2
  87. - TARGET_SET=2
  88. # ports
  89. - os: linux
  90. addons: *addon_conf
  91. env:
  92. - TEST=BUILD_PORTS
  93. - VM_AMOUNT=1
  94. - TARGET_SET=1
  95. - os: windows
  96. env:
  97. - TEST=BUILD_TARGETS_WINDOWS
  98. - VM_AMOUNT=1
  99. - TARGET_SET=1
  100. before_install:
  101. - printenv
  102. - export GOPATH=$HOME/gopath
  103. - go version
  104. install:
  105. - git clone https://github.com/JuulLabs-OSS/mynewt-travis-ci $HOME/ci
  106. - chmod +x $HOME/ci/*.sh
  107. - |
  108. if [ "${TEST}" == "STYLE" ]; then
  109. pip3 install requests
  110. else
  111. $HOME/ci/${TRAVIS_OS_NAME}_travis_install.sh
  112. fi
  113. before_script:
  114. - |
  115. if [ "${TEST}" == "STYLE" ]; then
  116. $HOME/ci/install_uncrustify.sh
  117. else
  118. newt version
  119. gcc --version
  120. if [ "${TEST}" != "TEST_ALL" ]; then arm-none-eabi-gcc --version; fi
  121. cp -R $HOME/ci/mynewt-nimble-project.yml project.yml
  122. mkdir -p targets
  123. cp -R $HOME/ci/mynewt-nimble-targets targets
  124. $HOME/ci/prepare_test.sh $VM_AMOUNT
  125. mkdir -p repos && pushd repos/
  126. git clone --depth=1 https://github.com/apache/mynewt-core apache-mynewt-core
  127. git clone --depth=1 https://github.com/JuulLabs-OSS/mcuboot mcuboot
  128. git clone --depth=1 https://github.com/apache/mynewt-mcumgr apache-mynewt-mcumgr
  129. popd
  130. fi
  131. script:
  132. - |
  133. if [ "${TEST}" == "STYLE" ]; then
  134. python3 $HOME/ci/check_style.py
  135. else
  136. $HOME/ci/run_test.sh
  137. fi
  138. cache:
  139. directories:
  140. - $HOME/TOOLCHAIN
  141. - $HOME/Library/Caches/Homebrew