ci.yaml 4.5 KB

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