ci.yaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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: swift:5.6-focal
  28. # No TSAN because of: https://github.com/apple/swift/issues/59068
  29. # swift-test-flags: "--sanitize=thread"
  30. - image: swift:5.5-focal
  31. swift-test-flags: "--sanitize=thread"
  32. - image: swift:5.4-focal
  33. swift-test-flags: "--sanitize=thread"
  34. name: Build and Test on ${{ matrix.image }}
  35. runs-on: ubuntu-latest
  36. container:
  37. image: ${{ matrix.image }}
  38. steps:
  39. - uses: actions/checkout@v3
  40. - name: 🔧 Build
  41. run: swift build ${{ matrix.swift-build-flags }}
  42. timeout-minutes: 20
  43. - name: 🧪 Test
  44. # Skip tests on 5.6: https://bugs.swift.org/browse/SR-15955
  45. if: ${{ matrix.image != 'swift:5.6-focal' }}
  46. run: swift test ${{ matrix.swift-test-flags }}
  47. timeout-minutes: 20
  48. performance-tests:
  49. strategy:
  50. fail-fast: false
  51. matrix:
  52. include:
  53. - image: swift:5.6-focal
  54. env:
  55. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 429000
  56. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 177000
  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: 175000
  61. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 182000
  62. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 182000
  63. - image: swift:5.5-focal
  64. env:
  65. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 459000
  66. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 189000
  67. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  68. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  69. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  70. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 186000
  71. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 193000
  72. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 193000
  73. - image: swift:5.4-focal
  74. env:
  75. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 459000
  76. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 189000
  77. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  78. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  79. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  80. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 186000
  81. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 193000
  82. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 193000
  83. name: Performance Tests on ${{ matrix.image }}
  84. runs-on: ubuntu-latest
  85. container:
  86. image: ${{ matrix.image }}
  87. steps:
  88. - uses: actions/checkout@v3
  89. - name: 🧮 Allocation Counting Tests
  90. run: ./Performance/allocations/test-allocation-counts.sh
  91. env: ${{ matrix.env }}
  92. timeout-minutes: 20
  93. integration-tests:
  94. strategy:
  95. fail-fast: false
  96. matrix:
  97. include:
  98. - image: swift:5.6-focal
  99. - image: swift:5.5-focal
  100. - image: swift:5.4-focal
  101. name: Integration Tests on ${{ matrix.image }}
  102. runs-on: ubuntu-latest
  103. container:
  104. image: ${{ matrix.image }}
  105. steps:
  106. - uses: actions/checkout@v3
  107. - name: Build without NIOSSL
  108. run: swift build
  109. env:
  110. GRPC_NO_NIO_SSL: 1
  111. timeout-minutes: 20
  112. - name: Test without NIOSSL
  113. run: swift test
  114. env:
  115. GRPC_NO_NIO_SSL: 1
  116. timeout-minutes: 20