.travis.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #
  2. # Copyright 2017, gRPC Authors All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. # Travis CI build file for gRPC Swift.
  17. language: minimal
  18. jobs:
  19. include:
  20. # Sanity checks for PRs.
  21. - &sanity
  22. stage: "Preflight Checks"
  23. name: "Sanity (license headers and formatting)"
  24. os: linux
  25. dist: bionic
  26. install: ./.travis-install.sh -f # install swiftformat
  27. script: ./.travis-script.sh -s # just sanity
  28. env: SWIFT_VERSION=5.4
  29. # Tests for each PR.
  30. - &tests
  31. stage: "Test"
  32. name: "Unit Tests: Ubuntu 18.04 (Swift 5.4)"
  33. os: linux
  34. dist: bionic
  35. install: ./.travis-install.sh -p # install protoc
  36. script: ./.travis-script.sh -t -a # tests with tsan, run allocation tests
  37. env:
  38. - SWIFT_VERSION=5.4
  39. - MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests=515000
  40. - MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request=227000
  41. - MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests=112000
  42. - MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request=67000
  43. - MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request=63000
  44. - MAX_ALLOCS_ALLOWED_unary_1k_ping_pong=216000
  45. - <<: *tests
  46. name: "Unit Tests: Ubuntu 18.04 (Swift 5.3)"
  47. script: ./.travis-script.sh -t -a # test with tsan, run allocation tests
  48. env:
  49. - SWIFT_VERSION=5.3.3
  50. - MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests=515000
  51. - MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request=227000
  52. - MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests=112000
  53. - MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request=67000
  54. - MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request=63000
  55. - MAX_ALLOCS_ALLOWED_unary_1k_ping_pong=216000
  56. - <<: *tests
  57. name: "Unit Tests: Ubuntu 18.04 (Swift 5.2)"
  58. script: ./.travis-script.sh -a # run allocation tests
  59. env:
  60. - SWIFT_VERSION=5.2.5
  61. - MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests=526000
  62. - MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request=229000
  63. - MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests=112000
  64. - MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request=67000
  65. - MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request=63000
  66. - MAX_ALLOCS_ALLOWED_unary_1k_ping_pong=217000
  67. - <<: *tests
  68. name: "Unit Tests: Xcode 12.2"
  69. os: osx
  70. osx_image: xcode12.2
  71. script: ./.travis-script.sh
  72. - <<: *tests
  73. name: "Unit Tests: Xcode 11.6"
  74. os: osx
  75. osx_image: xcode11.6
  76. script: ./.travis-script.sh
  77. # Interop Tests.
  78. - &interop_tests
  79. stage: "Interoperability Tests"
  80. # Linux
  81. name: "Interoperability Tests: Ubuntu 18.04 (Swift 5.4)"
  82. os: linux
  83. dist: bionic
  84. install: ./.travis-install.sh -p -i # install protoc and interop server
  85. script: ./.travis-script.sh -i # interop tests
  86. env: SWIFT_VERSION=5.4
  87. - <<: *interop_tests
  88. name: "Interoperability Tests: Ubuntu 18.04 (Swift 5.3)"
  89. env: SWIFT_VERSION=5.3.3
  90. - <<: *interop_tests
  91. name: "Interoperability Tests: Ubuntu 18.04 (Swift 5.2)"
  92. env: SWIFT_VERSION=5.2.5
  93. - <<: *interop_tests
  94. name: "Interoperability Tests: Xcode 12.2"
  95. os: osx
  96. osx_image: xcode12.2
  97. - <<: *interop_tests
  98. name: "Interoperability Tests: Xcode 11.6"
  99. os: osx
  100. osx_image: xcode11.6
  101. allow_failures:
  102. # Swift Development builds are allowed to fail since they're pre-release.
  103. - <<: *development
  104. stages:
  105. - name: "Preflight Checks"
  106. # Always run this stage.
  107. - name: "Test"
  108. # Only run when pushing (or merging) to main
  109. - name: "Interoperability Tests"
  110. if: type = push AND branch = main
  111. cache:
  112. apt: true
  113. directories:
  114. - $HOME/bin_cache
  115. - $HOME/zip_cache
  116. addons:
  117. apt:
  118. packages:
  119. - build-essential
  120. - curl
  121. - unzip
  122. - zip
  123. - pkg-config
  124. - g++
  125. - zlib1g-dev
  126. - python3