ci.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. 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@v2
  39. - name: 🔧 Build
  40. run: swift build ${{ matrix.swift-build-flags }}
  41. timeout-minutes: 20
  42. - name: 🧪 Test
  43. run: swift test ${{ matrix.swift-test-flags }}
  44. timeout-minutes: 20
  45. performance-tests:
  46. strategy:
  47. fail-fast: false
  48. matrix:
  49. include:
  50. - image: swift:5.6-focal
  51. env:
  52. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 429000
  53. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 177000
  54. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  55. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  56. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  57. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 175000
  58. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 182000
  59. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 182000
  60. - image: swift:5.5-focal
  61. env:
  62. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 459000
  63. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 189000
  64. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  65. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  66. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  67. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 186000
  68. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 193000
  69. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 193000
  70. - image: swift:5.4-focal
  71. env:
  72. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 459000
  73. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 189000
  74. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  75. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  76. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  77. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 186000
  78. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 193000
  79. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 193000
  80. name: Performance Tests on ${{ matrix.image }}
  81. runs-on: ubuntu-latest
  82. container:
  83. image: ${{ matrix.image }}
  84. steps:
  85. - uses: actions/checkout@v2
  86. - name: 🧮 Allocation Counting Tests
  87. run: ./Performance/allocations/test-allocation-counts.sh
  88. env: ${{ matrix.env }}
  89. timeout-minutes: 20
  90. integration-tests:
  91. strategy:
  92. fail-fast: false
  93. matrix:
  94. include:
  95. - image: swift:5.6-focal
  96. - image: swift:5.5-focal
  97. - image: swift:5.4-focal
  98. name: Integration Tests on ${{ matrix.image }}
  99. runs-on: ubuntu-latest
  100. container:
  101. image: ${{ matrix.image }}
  102. steps:
  103. - uses: actions/checkout@v2
  104. - name: Build without NIOSSL
  105. run: swift build
  106. env:
  107. GRPC_NO_NIO_SSL: 1
  108. timeout-minutes: 20
  109. - name: Test without NIOSSL
  110. run: swift test
  111. env:
  112. GRPC_NO_NIO_SSL: 1
  113. timeout-minutes: 20