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.

124 lines
4.6 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. ("Build (5th run)", "BuildLast"),
  24. ("Test all", "TestAll"),
  25. ]
  26. if __name__ == "__main__":
  27. s = ""
  28. # Initial config
  29. s += "# This file was inspired from https://github.com/google/fruit\n"
  30. s += "\n"
  31. s += "#\n"
  32. s += "# General config\n"
  33. s += "#\n"
  34. s += "branches:\n"
  35. s += " only:\n"
  36. s += " - master\n"
  37. s += " - stable\n"
  38. s += "dist: trusty\n"
  39. s += "language: cpp\n"
  40. s += "\n"
  41. s += "# Enable caching\n"
  42. s += "cache:\n"
  43. s += " timeout: 1000\n"
  44. s += " directories:\n"
  45. s += " - build\n"
  46. s += " - travis/mtime_cache\n"
  47. s += "\n"
  48. s += "# Enable docker support\n"
  49. s += "services:\n"
  50. s += "- docker\n"
  51. s += "sudo: required\n"
  52. s += "\n"
  53. s += "notifications:\n"
  54. s += " email:\n"
  55. s += " on_failure: always\n"
  56. s += " on_success: change\n"
  57. s += " recipients:\n"
  58. s += ' secure: "Q9CW/PtyWkZwExDrfFFb9n1STGYsRfI6awv1bZHcGwfrDvhpXoMCuF8CwviIfilm7fFJJEoKizTtdRpY0HrOnY/8KY111xrtcFYosxdndv7xbESodIxQOUoIEFCO0mCNHwWYisoi3dAA7H3Yn661EsxluwHjzX5vY0xSbw0n229hlsFz092HwGLSU33zHl7eXpQk+BOFmBTRGlOq9obtDZ17zbHz1oXFZntHK/JDUIYP0b0uq8NvE2jM6CIVdcuSwmIkOhZJoO2L3Py3rBbPci+L2PSK4Smv2UjCPF8KusnOaFIyDB3LcNM9Jqq5ssJMrK/KaO6BiuYrOZXYWZ7KEg3Y/naC8HjOH1dzty+P7oW46sb9F03pTsufqD4R7wcK+9wROTztO6aJPDG/IPH7EWgrBTxqlOkVRwi2eYuQouZpZUW6EMClKbMHMIxCH2S8aOk/r1w2cNwmPEcunnP0nl413x/ByHr4fTPFykPj8pQxIsllYjpdWBRQfDOauKWGzk6LcrFW0qpWP+/aJ2vYu/IoZQMG5lMHbp6Y1Lg09pYm7Q983v3b7D+JvXhOXMyGq91HyPahA2wwKoG1GA4uoZ2I95/IFYNiKkelDd3WTBoFLNF9YFoEJNdCywm1fO2WY4WkyEFBuQcgDA+YpFMJJMxjTbivYk9jvHk2gji//2w="\n'
  59. s += "\n"
  60. s += "#\n"
  61. s += "# Configurations\n"
  62. s += "#\n"
  63. s += "jobs:\n"
  64. s += " include:\n"
  65. # Generate all configurations
  66. for stage in stages:
  67. s += "\n"
  68. s += " ###\n"
  69. s += " # Stage: {}\n".format(stage[0])
  70. s += " ###\n"
  71. s += "\n"
  72. # Mac OS X
  73. for config in configs_mac:
  74. osx = config[0]
  75. compiler = "{}{}".format(config[1], config[2])
  76. s += " # {}\n".format(osx)
  77. buildConfig = ""
  78. for build in build_types:
  79. buildConfig += " - stage: {}\n".format(stage[0])
  80. buildConfig += " os: osx\n"
  81. buildConfig += " compiler: {}\n".format(config[1])
  82. buildConfig += " env: CONFIG={} COMPILER={} STL=libc++\n".format(build, compiler)
  83. buildConfig += " install:\n"
  84. if stage[1] == "Build1":
  85. buildConfig += " - rm -rf build\n"
  86. buildConfig += " - travis/install_osx.sh\n"
  87. buildConfig += " script:\n"
  88. buildConfig += " - travis/build.sh {}\n".format(stage[1])
  89. buildConfig += " after_failure:\n"
  90. buildConfig += " - find build -iname '*err*.log' -type f -print -exec cat {} \;\n"
  91. s += buildConfig
  92. # Linux via Docker
  93. for config in configs_linux:
  94. linux = config[0]
  95. compiler = "{}{}".format(config[1], config[2])
  96. s += " # {}\n".format(linux)
  97. buildConfig = ""
  98. for build in build_types:
  99. buildConfig += " - stage: {}\n".format(stage[0])
  100. buildConfig += " os: linux\n"
  101. buildConfig += " compiler: {}\n".format(config[1])
  102. buildConfig += " env: CONFIG={} LINUX={} COMPILER={}\n".format(build, linux, compiler)
  103. buildConfig += " install:\n"
  104. if stage[1] == "Build1":
  105. buildConfig += " - rm -rf build\n"
  106. buildConfig += " - travis/install_linux.sh\n"
  107. buildConfig += " script:\n"
  108. buildConfig += " - travis/build.sh {}\n".format(stage[1])
  109. buildConfig += " before_cache:\n"
  110. buildConfig += " - docker cp storm:/storm/. .\n"
  111. buildConfig += " after_failure:\n"
  112. buildConfig += " - find build -iname '*err*.log' -type f -print -exec cat {} \;\n"
  113. s += buildConfig
  114. print(s)