ci.yaml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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@v4
  15. - uses: actions/cache/restore@v4
  16. with:
  17. path: scripts/.swift-format-source
  18. key: ${{ runner.os }}-swift-format
  19. - name: "Formatting and License Headers check"
  20. run: |
  21. ./scripts/sanity.sh
  22. - uses: actions/cache/save@v4
  23. with:
  24. path: scripts/.swift-format-source
  25. key: ${{ runner.os }}-swift-format
  26. unit-tests:
  27. strategy:
  28. fail-fast: false
  29. matrix:
  30. include:
  31. - image: swiftlang/swift:nightly-jammy
  32. # No TSAN because of: https://github.com/apple/swift/issues/59068
  33. # swift-test-flags: "--sanitize=thread"
  34. - image: swiftlang/swift:nightly-6.0-jammy
  35. # No TSAN because of: https://github.com/apple/swift/issues/59068
  36. # swift-test-flags: "--sanitize=thread"
  37. - image: swift:5.10.1-noble
  38. # No TSAN because of: https://github.com/apple/swift/issues/59068
  39. # swift-test-flags: "--sanitize=thread"
  40. - image: swift:5.9-jammy
  41. # No TSAN because of: https://github.com/apple/swift/issues/59068
  42. # swift-test-flags: "--sanitize=thread"
  43. - image: swift:5.8-focal
  44. # No TSAN because of: https://github.com/apple/swift/issues/59068
  45. # swift-test-flags: "--sanitize=thread"
  46. name: Build and Test on ${{ matrix.image }}
  47. runs-on: ubuntu-latest
  48. container:
  49. image: ${{ matrix.image }}
  50. steps:
  51. - uses: actions/checkout@v4
  52. - name: 🔧 Build
  53. run: swift build ${{ matrix.swift-build-flags }}
  54. timeout-minutes: 20
  55. - name: 🧪 Test
  56. run: swift test ${{ matrix.swift-test-flags }}
  57. timeout-minutes: 20
  58. performance-tests:
  59. strategy:
  60. fail-fast: false
  61. matrix:
  62. include:
  63. - image: swiftlang/swift:nightly-jammy
  64. swift-version: main
  65. env:
  66. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  67. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  68. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  69. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  70. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  71. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  72. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  73. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  74. - image: swiftlang/swift:nightly-6.0-jammy
  75. swift-version: main
  76. env:
  77. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  78. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  79. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  80. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  81. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  82. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  83. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  84. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  85. - image: swift:5.10.1-noble
  86. swift-version: '5.10'
  87. env:
  88. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  89. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  90. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  91. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  92. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  93. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  94. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  95. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  96. - image: swift:5.9-jammy
  97. swift-version: 5.9
  98. env:
  99. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  100. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  101. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  102. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  103. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  104. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  105. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  106. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  107. - image: swift:5.8-focal
  108. swift-version: 5.8
  109. env:
  110. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  111. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  112. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  113. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  114. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  115. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  116. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  117. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  118. name: Performance Tests on ${{ matrix.image }}
  119. runs-on: ubuntu-latest
  120. container:
  121. image: ${{ matrix.image }}
  122. steps:
  123. - uses: actions/checkout@v4
  124. - name: 🧮 Allocation Counting Tests
  125. run: ./Performance/allocations/test-allocation-counts.sh
  126. env: ${{ matrix.env }}
  127. timeout-minutes: 20
  128. - name: Install jemalloc for benchmarking
  129. run: apt update && apt-get install -y libjemalloc-dev
  130. timeout-minutes: 20
  131. - name: Run Benchmarks
  132. working-directory: ./Performance/Benchmarks
  133. run: swift package benchmark baseline check --no-progress --check-absolute-path Thresholds/${{ matrix.swift-version }}/
  134. timeout-minutes: 20
  135. integration-tests:
  136. strategy:
  137. fail-fast: false
  138. matrix:
  139. include:
  140. - image: swiftlang/swift:nightly-jammy
  141. - image: swiftlang/swift:nightly-6.0-jammy
  142. - image: swift:5.10.1-noble
  143. - image: swift:5.9-jammy
  144. - image: swift:5.8-focal
  145. name: Integration Tests on ${{ matrix.image }}
  146. runs-on: ubuntu-latest
  147. container:
  148. image: ${{ matrix.image }}
  149. steps:
  150. - uses: actions/checkout@v4
  151. - name: Build without NIOSSL
  152. run: swift build
  153. env:
  154. GRPC_NO_NIO_SSL: 1
  155. timeout-minutes: 20
  156. - name: Test without NIOSSL
  157. run: swift test
  158. env:
  159. GRPC_NO_NIO_SSL: 1
  160. timeout-minutes: 20