ci.yaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. SWIFTFORMAT_VERSION=0.49.4
  18. git clone --depth 1 --branch "$SWIFTFORMAT_VERSION" "https://github.com/nicklockwood/SwiftFormat" "$HOME/SwiftFormat"
  19. swift build --package-path "$HOME/SwiftFormat" --product swiftformat
  20. export PATH=$PATH:"$(swift build --package-path "$HOME/SwiftFormat" --show-bin-path)"
  21. ./scripts/sanity.sh
  22. unit-tests:
  23. strategy:
  24. fail-fast: false
  25. matrix:
  26. include:
  27. - image: swiftlang/swift:nightly-focal
  28. # No TSAN because of: https://github.com/apple/swift/issues/59068
  29. # swift-test-flags: "--sanitize=thread"
  30. - image: swift:5.7-jammy
  31. # No TSAN because of: https://github.com/apple/swift/issues/59068
  32. # swift-test-flags: "--sanitize=thread"
  33. - image: swift:5.6-focal
  34. # No TSAN because of: https://github.com/apple/swift/issues/59068
  35. # swift-test-flags: "--sanitize=thread"
  36. - image: swift:5.5-focal
  37. swift-test-flags: "--sanitize=thread"
  38. name: Build and Test on ${{ matrix.image }}
  39. runs-on: ubuntu-latest
  40. container:
  41. image: ${{ matrix.image }}
  42. steps:
  43. - uses: actions/checkout@v3
  44. - name: 🔧 Build
  45. run: swift build ${{ matrix.swift-build-flags }}
  46. timeout-minutes: 20
  47. - name: 🧪 Test
  48. # Skip tests on 5.6: https://bugs.swift.org/browse/SR-15955
  49. if: ${{ matrix.image != 'swift:5.6-focal' }}
  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-focal
  58. env:
  59. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 428000
  60. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 176000
  61. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 112000
  62. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 67000
  63. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 63000
  64. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 174000
  65. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 181000
  66. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 181000
  67. - image: swift:5.7-jammy
  68. env:
  69. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 428000
  70. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 176000
  71. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 112000
  72. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 67000
  73. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 63000
  74. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 174000
  75. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 181000
  76. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 181000
  77. - image: swift:5.6-focal
  78. env:
  79. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 429000
  80. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 177000
  81. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 112000
  82. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 67000
  83. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 63000
  84. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 175000
  85. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 182000
  86. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 182000
  87. - image: swift:5.5-focal
  88. env:
  89. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 459000
  90. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 189000
  91. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 112000
  92. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 67000
  93. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 63000
  94. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 186000
  95. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 193000
  96. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 193000
  97. name: Performance Tests on ${{ matrix.image }}
  98. runs-on: ubuntu-latest
  99. container:
  100. image: ${{ matrix.image }}
  101. steps:
  102. - uses: actions/checkout@v3
  103. - name: 🧮 Allocation Counting Tests
  104. run: ./Performance/allocations/test-allocation-counts.sh
  105. env: ${{ matrix.env }}
  106. timeout-minutes: 20
  107. integration-tests:
  108. strategy:
  109. fail-fast: false
  110. matrix:
  111. include:
  112. - image: swiftlang/swift:nightly-focal
  113. - image: swift:5.7-jammy
  114. - image: swift:5.6-focal
  115. - image: swift:5.5-focal
  116. name: Integration Tests on ${{ matrix.image }}
  117. runs-on: ubuntu-latest
  118. container:
  119. image: ${{ matrix.image }}
  120. steps:
  121. - uses: actions/checkout@v3
  122. - name: Build without NIOSSL
  123. run: swift build
  124. env:
  125. GRPC_NO_NIO_SSL: 1
  126. timeout-minutes: 20
  127. - name: Test without NIOSSL
  128. run: swift test
  129. env:
  130. GRPC_NO_NIO_SSL: 1
  131. timeout-minutes: 20