ci.yaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. name: CI
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. jobs:
  8. preflight:
  9. name: License Header and Formatting Checks
  10. runs-on: ubuntu-latest
  11. container:
  12. image: swift
  13. steps:
  14. - uses: actions/checkout@v2
  15. - name: "Formatting and License Headers check"
  16. run: |
  17. SWIFTFORMAT_VERSION=0.46.3
  18. git clone --depth 1 --branch "$SWIFTFORMAT_VERSION" "https://github.com/nicklockwood/SwiftFormat" "$HOME/SwiftFormat"
  19. swift build --package-path "$HOME/SwiftFormat" --product swiftformat
  20. export PATH=$PATH:"$(swift build --package-path "$HOME/SwiftFormat" --show-bin-path)"
  21. ./scripts/sanity.sh
  22. unit-tests:
  23. strategy:
  24. fail-fast: false
  25. matrix:
  26. include:
  27. - image: swift:5.6-focal
  28. swift-test-flags: "--enable-test-discovery --sanitize=thread"
  29. - image: swift:5.5-focal
  30. swift-test-flags: "--enable-test-discovery --sanitize=thread"
  31. - image: swift:5.4-focal
  32. swift-test-flags: "--enable-test-discovery --sanitize=thread"
  33. - image: swift:5.3-focal
  34. swift-build-flags: "--enable-test-discovery"
  35. swift-test-flags: "--enable-test-discovery"
  36. - image: swift:5.2-bionic
  37. swift-build-flags: "--enable-test-discovery"
  38. swift-test-flags: "--enable-test-discovery"
  39. name: Build and Test on ${{ matrix.image }}
  40. runs-on: ubuntu-latest
  41. container:
  42. image: ${{ matrix.image }}
  43. steps:
  44. - uses: actions/checkout@v2
  45. - name: 🔧 Build
  46. run: swift build ${{ matrix.swift-build-flags }}
  47. timeout-minutes: 20
  48. - name: 🧪 Test
  49. # Skip tests on 5.6: https://bugs.swift.org/browse/SR-15955
  50. if: ${{ matrix.image != 'swift:5.6-focal' }}
  51. run: swift test ${{ matrix.swift-test-flags }}
  52. timeout-minutes: 20
  53. performance-tests:
  54. strategy:
  55. fail-fast: false
  56. matrix:
  57. include:
  58. - image: swift:5.6-focal
  59. env:
  60. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 429000
  61. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 177000
  62. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  63. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  64. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  65. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 175000
  66. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 182000
  67. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 182000
  68. - image: swift:5.5-focal
  69. env:
  70. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 459000
  71. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 189000
  72. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  73. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  74. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  75. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 186000
  76. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 193000
  77. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 193000
  78. - image: swift:5.4-focal
  79. env:
  80. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 459000
  81. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 189000
  82. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  83. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  84. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  85. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 186000
  86. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 193000
  87. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 193000
  88. - image: swift:5.3-focal
  89. env:
  90. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 460000
  91. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 190000
  92. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  93. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  94. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  95. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 187000
  96. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 194000
  97. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 194000
  98. name: Performance Tests on ${{ matrix.image }}
  99. runs-on: ubuntu-latest
  100. container:
  101. image: ${{ matrix.image }}
  102. steps:
  103. - uses: actions/checkout@v2
  104. - name: 🧮 Allocation Counting Tests
  105. run: ./Performance/allocations/test-allocation-counts.sh
  106. env: ${{ matrix.env }}
  107. timeout-minutes: 20
  108. integration-tests:
  109. strategy:
  110. fail-fast: false
  111. matrix:
  112. include:
  113. - image: swift:5.6-focal
  114. - image: swift:5.5-focal
  115. - image: swift:5.4-focal
  116. - image: swift:5.3-focal
  117. - image: swift:5.2-bionic
  118. name: Integration Tests on ${{ matrix.image }}
  119. runs-on: ubuntu-latest
  120. container:
  121. image: ${{ matrix.image }}
  122. steps:
  123. - uses: actions/checkout@v2
  124. - name: Build without NIOSSL
  125. run: swift build
  126. env:
  127. GRPC_NO_NIO_SSL: 1
  128. timeout-minutes: 20
  129. - name: Test without NIOSSL
  130. # Skip tests on 5.6: https://bugs.swift.org/browse/SR-15955
  131. if: ${{ matrix.image != 'swift:5.6-focal' }}
  132. run: swift test --enable-test-discovery
  133. env:
  134. GRPC_NO_NIO_SSL: 1
  135. timeout-minutes: 20