ci.yaml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. name: CI
  2. on:
  3. push:
  4. branches: ["release/1.x"]
  5. pull_request:
  6. branches: ["release/1.x"]
  7. jobs:
  8. preflight:
  9. name: License Header and Formatting Checks
  10. runs-on: ubuntu-latest
  11. container:
  12. image: swift:6.0-jammy
  13. steps:
  14. - name: "Checkout repository"
  15. uses: actions/checkout@v4
  16. - name: Mark the workspace as safe
  17. run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
  18. - name: "Install protoc"
  19. run: apt update && apt install -y protobuf-compiler
  20. - name: "Formatting, License Headers, and Generated Code check"
  21. run: |
  22. ./scripts/sanity.sh
  23. unit-tests:
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. include:
  28. - image: swiftlang/swift:nightly-jammy
  29. # No TSAN because of: https://github.com/apple/swift/issues/59068
  30. # swift-test-flags: "--sanitize=thread"
  31. - image: swift:6.0-jammy
  32. # No TSAN because of: https://github.com/apple/swift/issues/59068
  33. # swift-test-flags: "--sanitize=thread"
  34. - image: swift:5.10.1-noble
  35. # No TSAN because of: https://github.com/apple/swift/issues/59068
  36. # swift-test-flags: "--sanitize=thread"
  37. - image: swift:5.9-jammy
  38. # No TSAN because of: https://github.com/apple/swift/issues/59068
  39. # swift-test-flags: "--sanitize=thread"
  40. name: Build and Test on ${{ matrix.image }}
  41. runs-on: ubuntu-latest
  42. container:
  43. image: ${{ matrix.image }}
  44. steps:
  45. - uses: actions/checkout@v4
  46. - name: 🔧 Build
  47. run: swift build ${{ matrix.swift-build-flags }}
  48. timeout-minutes: 20
  49. - name: 🧪 Test
  50. run: swift test ${{ matrix.swift-test-flags }}
  51. timeout-minutes: 20
  52. performance-tests:
  53. strategy:
  54. fail-fast: false
  55. matrix:
  56. include:
  57. - image: swiftlang/swift:nightly-jammy
  58. swift-version: 'main'
  59. env:
  60. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  61. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  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: 163000
  66. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  67. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  68. - image: swift:6.0-jammy
  69. swift-version: '6.0'
  70. env:
  71. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  72. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  73. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  74. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  75. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  76. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  77. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  78. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  79. - image: swift:5.10.1-noble
  80. swift-version: '5.10'
  81. env:
  82. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  83. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  84. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  85. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  86. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  87. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  88. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  89. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  90. - image: swift:5.9-jammy
  91. swift-version: 5.9
  92. env:
  93. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  94. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  95. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  96. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  97. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  98. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  99. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  100. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  101. name: Performance Tests on ${{ matrix.image }}
  102. runs-on: ubuntu-latest
  103. container:
  104. image: ${{ matrix.image }}
  105. steps:
  106. - uses: actions/checkout@v4
  107. - name: 🧮 Allocation Counting Tests
  108. run: ./Performance/allocations/test-allocation-counts.sh
  109. env: ${{ matrix.env }}
  110. timeout-minutes: 20
  111. - name: Install jemalloc for benchmarking
  112. if: ${{ matrix.swift-version == '6.0' || matrix.swift-version == 'main' }}
  113. run: apt update && apt-get install -y libjemalloc-dev
  114. timeout-minutes: 20
  115. - name: Run Benchmarks
  116. if: ${{ matrix.swift-version == '6.0' || matrix.swift-version == 'main' }}
  117. working-directory: ./Performance/Benchmarks
  118. run: swift package benchmark baseline check --no-progress --check-absolute-path Thresholds/${{ matrix.swift-version }}/
  119. timeout-minutes: 20
  120. integration-tests:
  121. strategy:
  122. fail-fast: false
  123. matrix:
  124. include:
  125. - image: swiftlang/swift:nightly-jammy
  126. swift-tools-version: '6.0'
  127. supports-v2: true
  128. - image: swift:6.0-jammy
  129. swift-tools-version: '6.0'
  130. supports-v2: true
  131. - image: swift:5.10.1-noble
  132. swift-tools-version: '5.10'
  133. supports-v2: false
  134. - image: swift:5.9-jammy
  135. swift-tools-version: '5.9'
  136. supports-v2: false
  137. name: Integration Tests on ${{ matrix.image }}
  138. runs-on: ubuntu-latest
  139. container:
  140. image: ${{ matrix.image }}
  141. steps:
  142. - uses: actions/checkout@v4
  143. - name: Install protoc
  144. run: apt update && apt install -y protobuf-compiler
  145. - name: SwiftPM plugin test (v1)
  146. run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v1"
  147. - name: SwiftPM plugin test (v2)
  148. if: ${{ matrix.supports-v2 }}
  149. run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v2"
  150. - name: Build without NIOSSL
  151. run: swift build
  152. env:
  153. GRPC_NO_NIO_SSL: 1
  154. timeout-minutes: 20
  155. - name: Test without NIOSSL
  156. run: swift test
  157. env:
  158. GRPC_NO_NIO_SSL: 1
  159. timeout-minutes: 20