ci.yaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.52.0
  18. git clone --depth 1 --branch "$SWIFTFORMAT_VERSION" "https://github.com/nicklockwood/SwiftFormat" "$HOME/SwiftFormat"
  19. swift build -c release --package-path "$HOME/SwiftFormat" --product swiftformat
  20. export PATH=$PATH:"$(swift build -c release --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-jammy
  28. # No TSAN because of: https://github.com/apple/swift/issues/59068
  29. # swift-test-flags: "--sanitize=thread"
  30. - image: swift:5.9-jammy
  31. # No TSAN because of: https://github.com/apple/swift/issues/59068
  32. # swift-test-flags: "--sanitize=thread"
  33. - image: swift:5.8-focal
  34. # No TSAN because of: https://github.com/apple/swift/issues/59068
  35. # swift-test-flags: "--sanitize=thread"
  36. - image: swift:5.7-focal
  37. # No TSAN because of: https://github.com/apple/swift/issues/59068
  38. # swift-test-flags: "--sanitize=thread"
  39. name: Build and Test on ${{ matrix.image }}
  40. runs-on: ubuntu-latest
  41. container:
  42. image: ${{ matrix.image }}
  43. steps:
  44. - uses: actions/checkout@v3
  45. - name: 🔧 Build
  46. run: swift build ${{ matrix.swift-build-flags }}
  47. timeout-minutes: 20
  48. - name: 🧪 Test
  49. run: swift test ${{ matrix.swift-test-flags }}
  50. timeout-minutes: 20
  51. performance-tests:
  52. strategy:
  53. fail-fast: false
  54. matrix:
  55. include:
  56. - image: swiftlang/swift:nightly-jammy
  57. env:
  58. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  59. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  60. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  61. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  62. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  63. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  64. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  65. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  66. - image: swift:5.9-jammy
  67. env:
  68. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  69. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  70. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  71. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  72. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  73. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  74. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  75. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  76. - image: swift:5.8-focal
  77. env:
  78. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  79. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  80. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  81. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  82. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  83. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  84. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  85. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  86. - image: swift:5.7-focal
  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. integration-tests:
  107. strategy:
  108. fail-fast: false
  109. matrix:
  110. include:
  111. - image: swiftlang/swift:nightly-jammy
  112. - image: swift:5.9-jammy
  113. - image: swift:5.8-focal
  114. - image: swift:5.7-focal
  115. name: Integration Tests on ${{ matrix.image }}
  116. runs-on: ubuntu-latest
  117. container:
  118. image: ${{ matrix.image }}
  119. steps:
  120. - uses: actions/checkout@v3
  121. - name: Build without NIOSSL
  122. run: swift build
  123. env:
  124. GRPC_NO_NIO_SSL: 1
  125. timeout-minutes: 20
  126. - name: Test without NIOSSL
  127. run: swift test
  128. env:
  129. GRPC_NO_NIO_SSL: 1
  130. timeout-minutes: 20