ci.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. integration-tests:
  112. strategy:
  113. fail-fast: false
  114. matrix:
  115. include:
  116. - image: swiftlang/swift:nightly-jammy
  117. swift-tools-version: '6.0'
  118. - image: swift:6.0-jammy
  119. swift-tools-version: '6.0'
  120. - image: swift:5.10.1-noble
  121. swift-tools-version: '5.10'
  122. - image: swift:5.9-jammy
  123. swift-tools-version: '5.9'
  124. name: Integration Tests on ${{ matrix.image }}
  125. runs-on: ubuntu-latest
  126. container:
  127. image: ${{ matrix.image }}
  128. steps:
  129. - uses: actions/checkout@v4
  130. - name: Install protoc
  131. run: apt update && apt install -y protobuf-compiler
  132. - name: SwiftPM plugin test (v1)
  133. run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v1"
  134. - name: Build without NIOSSL
  135. run: swift build
  136. env:
  137. GRPC_NO_NIO_SSL: 1
  138. timeout-minutes: 20
  139. - name: Test without NIOSSL
  140. run: swift test
  141. env:
  142. GRPC_NO_NIO_SSL: 1
  143. timeout-minutes: 20