ci.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.46.3
  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.5-focal
  28. swift-test-flags: "--enable-test-discovery"
  29. - image: swift:5.4-focal
  30. swift-test-flags: "--enable-test-discovery --sanitize=thread"
  31. - image: swift:5.3-focal
  32. swift-build-flags: "--enable-test-discovery"
  33. swift-test-flags: "--enable-test-discovery"
  34. - image: swift:5.2-bionic
  35. swift-build-flags: "--enable-test-discovery"
  36. swift-test-flags: "--enable-test-discovery"
  37. name: Build and Test on ${{ matrix.image }}
  38. runs-on: ubuntu-latest
  39. container:
  40. image: ${{ matrix.image }}
  41. steps:
  42. - uses: actions/checkout@v2
  43. - name: 🔧 Build
  44. run: swift build ${{ matrix.swift-build-flags }}
  45. timeout-minutes: 20
  46. - name: 🧪 Test
  47. run: swift test ${{ matrix.swift-test-flags }}
  48. timeout-minutes: 20
  49. performance-tests:
  50. strategy:
  51. fail-fast: false
  52. matrix:
  53. include:
  54. - image: swift:5.5-focal
  55. env:
  56. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 480000
  57. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 201000
  58. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  59. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  60. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  61. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 194000
  62. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 201000
  63. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 201000
  64. - image: swift:5.4-focal
  65. env:
  66. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 480000
  67. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 201000
  68. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  69. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  70. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  71. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 194000
  72. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 201000
  73. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 201000
  74. - image: swift:5.3-focal
  75. env:
  76. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 481000
  77. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 202000
  78. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  79. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  80. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  81. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 195000
  82. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 202000
  83. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 202000
  84. name: Performance Tests on ${{ matrix.image }}
  85. runs-on: ubuntu-latest
  86. container:
  87. image: ${{ matrix.image }}
  88. steps:
  89. - uses: actions/checkout@v2
  90. - name: 🧮 Allocation Counting Tests
  91. run: ./Performance/allocations/test-allocation-counts.sh
  92. env: ${{ matrix.env }}
  93. timeout-minutes: 20
  94. integration-tests:
  95. strategy:
  96. fail-fast: false
  97. matrix:
  98. include:
  99. - image: swift:5.5-focal
  100. - image: swift:5.4-focal
  101. - image: swift:5.3-focal
  102. - image: swift:5.2-bionic
  103. name: Integration Tests on ${{ matrix.image }}
  104. runs-on: ubuntu-latest
  105. container:
  106. image: ${{ matrix.image }}
  107. steps:
  108. - uses: actions/checkout@v2
  109. - name: Build without NIOSSL
  110. run: swift build
  111. env:
  112. GRPC_NO_NIO_SSL: 1
  113. timeout-minutes: 20
  114. - name: Test without NIOSSL
  115. run: swift test --enable-test-discovery
  116. env:
  117. GRPC_NO_NIO_SSL: 1
  118. timeout-minutes: 20