ci.yaml 4.4 KB

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