ci.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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: swift:5.10-jammy
  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. - image: swift:5.8-focal
  41. # No TSAN because of: https://github.com/apple/swift/issues/59068
  42. # swift-test-flags: "--sanitize=thread"
  43. name: Build and Test on ${{ matrix.image }}
  44. runs-on: ubuntu-latest
  45. container:
  46. image: ${{ matrix.image }}
  47. steps:
  48. - uses: actions/checkout@v4
  49. - name: 🔧 Build
  50. run: swift build ${{ matrix.swift-build-flags }}
  51. timeout-minutes: 20
  52. - name: 🧪 Test
  53. run: swift test ${{ matrix.swift-test-flags }}
  54. timeout-minutes: 20
  55. performance-tests:
  56. strategy:
  57. fail-fast: false
  58. matrix:
  59. include:
  60. - image: swiftlang/swift:nightly-jammy
  61. swift-version: main
  62. env:
  63. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  64. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  65. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  66. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  67. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  68. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  69. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  70. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  71. - image: swift:5.10-jammy
  72. swift-version: '5.10'
  73. env:
  74. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  75. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  76. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  77. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  78. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  79. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  80. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  81. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  82. - image: swift:5.9-jammy
  83. swift-version: 5.9
  84. env:
  85. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  86. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  87. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  88. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  89. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  90. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  91. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  92. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  93. - image: swift:5.8-focal
  94. swift-version: 5.8
  95. env:
  96. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  97. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  98. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  99. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  100. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  101. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  102. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  103. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  104. name: Performance Tests on ${{ matrix.image }}
  105. runs-on: ubuntu-latest
  106. container:
  107. image: ${{ matrix.image }}
  108. steps:
  109. - uses: actions/checkout@v4
  110. - name: 🧮 Allocation Counting Tests
  111. run: ./Performance/allocations/test-allocation-counts.sh
  112. env: ${{ matrix.env }}
  113. timeout-minutes: 20
  114. - name: Install jemalloc for benchmarking
  115. run: apt update && apt-get install -y libjemalloc-dev
  116. timeout-minutes: 20
  117. - name: Run Benchmarks
  118. working-directory: ./Performance/Benchmarks
  119. run: swift package benchmark baseline check --no-progress --check-absolute-path Thresholds/${{ matrix.swift-version }}/
  120. timeout-minutes: 20
  121. integration-tests:
  122. strategy:
  123. fail-fast: false
  124. matrix:
  125. include:
  126. - image: swiftlang/swift:nightly-jammy
  127. - image: swift:5.10-jammy
  128. - image: swift:5.9-jammy
  129. - image: swift:5.8-focal
  130. name: Integration Tests on ${{ matrix.image }}
  131. runs-on: ubuntu-latest
  132. container:
  133. image: ${{ matrix.image }}
  134. steps:
  135. - uses: actions/checkout@v4
  136. - name: Build without NIOSSL
  137. run: swift build
  138. env:
  139. GRPC_NO_NIO_SSL: 1
  140. timeout-minutes: 20
  141. - name: Test without NIOSSL
  142. run: swift test
  143. env:
  144. GRPC_NO_NIO_SSL: 1
  145. timeout-minutes: 20