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.

110 lines
3.5 KiB

  1. # Configuration for Linux
  2. configs_linux = [
  3. # OS, compiler
  4. ("ubuntu-16.10", "gcc", "-6"),
  5. ("debian-9", "gcc", "-6"),
  6. ]
  7. # Configurations for Mac
  8. configs_mac = [
  9. # OS, compiler
  10. ("osx", "clang", "-4.0"),
  11. ]
  12. # Build types
  13. build_types = [
  14. "DefaultDebug",
  15. "DefaultRelease",
  16. ]
  17. # Stages in travis
  18. stages = [
  19. ("Build (1st run)", "Build1"),
  20. ("Build (2nd run)", "Build2"),
  21. ("Build (3rd run)", "Build3"),
  22. ("Build (4th run)", "Build4"),
  23. ("Test all", "TestAll"),
  24. ]
  25. if __name__ == "__main__":
  26. s = ""
  27. # Initial config
  28. s += "# This file was inspired from https://github.com/google/fruit\n"
  29. s += "\n"
  30. s += "#\n"
  31. s += "# General config\n"
  32. s += "#\n"
  33. s += "branches:\n"
  34. s += " only:\n"
  35. s += " - master\n"
  36. s += "dist: trusty\n"
  37. s += "language: cpp\n"
  38. s += "\n"
  39. s += "# Enable caching\n"
  40. s += "cache:\n"
  41. s += " timeout: 600\n"
  42. s += " directories:\n"
  43. s += " - build\n"
  44. s += " - travis/mtime_cache\n"
  45. s += "\n"
  46. s += "# Enable docker support\n"
  47. s += "services:\n"
  48. s += "- docker\n"
  49. s += "sudo: required\n"
  50. s += "\n"
  51. s += "#\n"
  52. s += "# Configurations\n"
  53. s += "#\n"
  54. s += "jobs:\n"
  55. s += " include:\n"
  56. # Generate all configurations
  57. for stage in stages:
  58. s += "\n"
  59. s += " ###\n"
  60. s += " # Stage: {}\n".format(stage[0])
  61. s += " ###\n"
  62. s += "\n"
  63. # Mac OS X
  64. for config in configs_mac:
  65. osx = config[0]
  66. compiler = "{}{}".format(config[1], config[2])
  67. s += " # {}\n".format(osx)
  68. buildConfig = ""
  69. for build in build_types:
  70. buildConfig += " - stage: {}\n".format(stage[0])
  71. buildConfig += " os: osx\n"
  72. buildConfig += " compiler: {}\n".format(config[1])
  73. buildConfig += " env: CONFIG={} COMPILER={} STL=libc++\n".format(build, compiler)
  74. buildConfig += " install:\n"
  75. buildConfig += " travis/install_osx.sh\n"
  76. buildConfig += " script:\n"
  77. buildConfig += " travis/build.sh {}\n".format(stage[1])
  78. buildConfig += " after_failure:\n"
  79. buildConfig += " - find build -iname '*err*.log' -type f -print -exec cat {} \;\n"
  80. s += buildConfig
  81. # Linux via Docker
  82. for config in configs_linux:
  83. linux = config[0]
  84. compiler = "{}{}".format(config[1], config[2])
  85. s += " # {}\n".format(linux)
  86. buildConfig = ""
  87. for build in build_types:
  88. buildConfig += " - stage: {}\n".format(stage[0])
  89. buildConfig += " os: linux\n"
  90. buildConfig += " compiler: {}\n".format(config[1])
  91. buildConfig += " env: CONFIG={} LINUX={} COMPILER={}\n".format(build, linux, compiler)
  92. buildConfig += " install:\n"
  93. buildConfig += " travis/install_linux.sh\n"
  94. buildConfig += " script:\n"
  95. buildConfig += " travis/build.sh {}\n".format(stage[1])
  96. buildConfig += " before_cache:\n"
  97. buildConfig += " docker cp storm:/storm/. .\n"
  98. buildConfig += " after_failure:\n"
  99. buildConfig += " - find build -iname '*err*.log' -type f -print -exec cat {} \;\n"
  100. s += buildConfig
  101. print(s)