ci.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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@v3
  15. - name: "Formatting and License Headers check"
  16. run: |
  17. ./scripts/sanity.sh
  18. unit-tests:
  19. strategy:
  20. fail-fast: false
  21. matrix:
  22. include:
  23. - image: swiftlang/swift:nightly-jammy
  24. # No TSAN because of: https://github.com/apple/swift/issues/59068
  25. # swift-test-flags: "--sanitize=thread"
  26. - image: swift:5.9-jammy
  27. # No TSAN because of: https://github.com/apple/swift/issues/59068
  28. # swift-test-flags: "--sanitize=thread"
  29. - image: swift:5.8-focal
  30. # No TSAN because of: https://github.com/apple/swift/issues/59068
  31. # swift-test-flags: "--sanitize=thread"
  32. - image: swift:5.7-focal
  33. # No TSAN because of: https://github.com/apple/swift/issues/59068
  34. # swift-test-flags: "--sanitize=thread"
  35. name: Build and Test on ${{ matrix.image }}
  36. runs-on: ubuntu-latest
  37. container:
  38. image: ${{ matrix.image }}
  39. steps:
  40. - uses: actions/checkout@v3
  41. - name: 🔧 Build
  42. run: swift build ${{ matrix.swift-build-flags }}
  43. timeout-minutes: 20
  44. - name: 🧪 Test
  45. run: swift test ${{ matrix.swift-test-flags }}
  46. timeout-minutes: 20
  47. performance-tests:
  48. strategy:
  49. fail-fast: false
  50. matrix:
  51. include:
  52. - image: swiftlang/swift:nightly-jammy
  53. swift-version: main
  54. env:
  55. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  56. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  57. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  58. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  59. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  60. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  61. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  62. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  63. - image: swift:5.9-jammy
  64. swift-version: 5.9
  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: swift:5.8-focal
  75. swift-version: 5.8
  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.7-focal
  86. swift-version: 5.7
  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. name: Performance Tests on ${{ matrix.image }}
  97. runs-on: ubuntu-latest
  98. container:
  99. image: ${{ matrix.image }}
  100. steps:
  101. - uses: actions/checkout@v3
  102. - name: 🧮 Allocation Counting Tests
  103. run: ./Performance/allocations/test-allocation-counts.sh
  104. env: ${{ matrix.env }}
  105. timeout-minutes: 20
  106. - name: Install jemalloc for benchmarking
  107. run: apt update && apt-get install -y libjemalloc-dev
  108. timeout-minutes: 20
  109. - name: Run Benchmarks
  110. working-directory: ./Performance/Benchmarks
  111. run: swift package benchmark baseline check --check-absolute-path Thresholds/${{ matrix.swift-version }}/
  112. timeout-minutes: 20
  113. integration-tests:
  114. strategy:
  115. fail-fast: false
  116. matrix:
  117. include:
  118. - image: swiftlang/swift:nightly-jammy
  119. - image: swift:5.9-jammy
  120. - image: swift:5.8-focal
  121. - image: swift:5.7-focal
  122. name: Integration Tests on ${{ matrix.image }}
  123. runs-on: ubuntu-latest
  124. container:
  125. image: ${{ matrix.image }}
  126. steps:
  127. - uses: actions/checkout@v3
  128. - name: Build without NIOSSL
  129. run: swift build
  130. env:
  131. GRPC_NO_NIO_SSL: 1
  132. timeout-minutes: 20
  133. - name: Test without NIOSSL
  134. run: swift test
  135. env:
  136. GRPC_NO_NIO_SSL: 1
  137. timeout-minutes: 20