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.

101 lines
3.1 KiB

8 years ago
8 years ago
8 years ago
8 years ago
  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 dependencies", "BuildDep"),
  20. ("Build library", "BuildLib"),
  21. ("Build all", "BuildAll"),
  22. ("Test all", "TestAll"),
  23. ]
  24. if __name__ == "__main__":
  25. s = ""
  26. # Initial config
  27. s += "# This file was inspired from https://github.com/google/fruit\n"
  28. s += "\n"
  29. s += "#\n"
  30. s += "# General config\n"
  31. s += "#\n"
  32. s += "branches:\n"
  33. s += " only:\n"
  34. s += " - master\n"
  35. s += "dist: trusty\n"
  36. s += "language: cpp\n"
  37. s += "\n"
  38. s += "# Enable caching\n"
  39. s += "cache:\n"
  40. s += " timeout: 600\n"
  41. s += " directories:\n"
  42. s += " - build\n"
  43. s += " - travis/mtime_cache\n"
  44. s += "\n"
  45. s += "# Enable docker support\n"
  46. s += "services:\n"
  47. s += "- docker\n"
  48. s += "sudo: required\n"
  49. s += "\n"
  50. s += "#\n"
  51. s += "# Configurations\n"
  52. s += "#\n"
  53. s += "jobs:\n"
  54. s += " include:\n"
  55. # Generate all configurations
  56. for stage in stages:
  57. s += "\n"
  58. s += " ###\n"
  59. s += " # Stage: {}\n".format(stage)
  60. s += " ###\n"
  61. s += "\n"
  62. # Linux via Docker
  63. for config in configs_linux:
  64. linux = config[0]
  65. compiler = "{}{}".format(config[1], config[2])
  66. s += " # {}\n".format(linux)
  67. for build in build_types:
  68. s += " - stage: {}\n".format(stage[0])
  69. s += " os: linux\n"
  70. s += " compiler: {}\n".format(config[1])
  71. s += " env: BUILD={} COMPILER={} LINUX={}\n".format(build, compiler, linux)
  72. s += " install: export OS=linux; export COMPILER='{}'; export LINUX='{}';\n".format(compiler, linux)
  73. s += " travis/install_linux.sh\n"
  74. s += " script: export OS=linux; export COMPILER='{}'; export LINUX='{}';\n".format(compiler, linux)
  75. s += " travis/postsubmit.sh {} {}\n".format(build, stage[1])
  76. s += " before_cache:\n"
  77. s += " docker cp storm:/storm/. .\n"
  78. # Mac OS X
  79. for config in configs_mac:
  80. osx = config[0]
  81. compiler = "{}{}".format(config[1], config[2])
  82. s += " # {}\n".format(osx)
  83. for build in build_types:
  84. s += " - stage: {}\n".format(stage[0])
  85. s += " os: osx\n"
  86. s += " compiler: {}\n".format(config[1])
  87. s += " env: BUILD={} COMPILER={} STL=libc++\n".format(build, compiler)
  88. s += " install: export OS=osx; export COMPILER='{}'; export STL='libc++';\n".format(compiler)
  89. s += " travis/install_osx.sh\n"
  90. s += " script: export OS=osx; export COMPILER='{}'; export STL='libc++';\n".format(compiler)
  91. s += " travis/postsubmit.sh {} {}\n".format(build, stage[1])
  92. print(s)