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.

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