ci.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. name: CI
  2. on:
  3. push:
  4. branches: ["release/1.x"]
  5. pull_request:
  6. branches: ["release/1.x"]
  7. jobs:
  8. preflight:
  9. name: License Header and Formatting Checks
  10. runs-on: ubuntu-latest
  11. container:
  12. image: swift:6.1
  13. steps:
  14. - name: "Checkout repository"
  15. uses: actions/checkout@v4
  16. - name: Mark the workspace as safe
  17. run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
  18. - name: "Install protoc"
  19. run: apt update && apt install -y protobuf-compiler
  20. - name: "Formatting, License Headers, and Generated Code check"
  21. run: |
  22. ./scripts/sanity.sh
  23. unit-tests:
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. include:
  28. - image: swift:6.1
  29. swift-build-flags: -c release
  30. - image: swift:6.0-jammy
  31. swift-build-flags: -c release
  32. - image: swift:5.10.1-noble
  33. swift-build-flags: -c release
  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@v4
  40. - name: 🔧 Build
  41. run: swift build ${{ matrix.swift-build-flags }}
  42. timeout-minutes: 20
  43. - name: 🧪 Test
  44. run: swift test ${{ matrix.swift-test-flags }}
  45. timeout-minutes: 20
  46. performance-tests:
  47. strategy:
  48. fail-fast: false
  49. matrix:
  50. include:
  51. - image: swift:6.1
  52. swift-version: '6.1'
  53. env:
  54. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  55. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  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: 163000
  60. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  61. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  62. - image: swift:6.0-jammy
  63. swift-version: '6.0'
  64. env:
  65. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  66. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  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: 163000
  71. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  72. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  73. - image: swift:5.10.1-noble
  74. swift-version: '5.10'
  75. env:
  76. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  77. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  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: 163000
  82. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  83. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  84. name: Performance Tests on ${{ matrix.image }}
  85. runs-on: ubuntu-latest
  86. container:
  87. image: ${{ matrix.image }}
  88. steps:
  89. - uses: actions/checkout@v4
  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:6.1
  100. swift-tools-version: '6.1'
  101. - image: swift:6.0-jammy
  102. swift-tools-version: '6.0'
  103. - image: swift:5.10.1-noble
  104. swift-tools-version: '5.10'
  105. name: Integration Tests on ${{ matrix.image }}
  106. runs-on: ubuntu-latest
  107. container:
  108. image: ${{ matrix.image }}
  109. steps:
  110. - uses: actions/checkout@v4
  111. - name: Install protoc
  112. run: apt update && apt install -y protobuf-compiler
  113. - name: SwiftPM plugin test (v1)
  114. run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v1"
  115. - name: Build without NIOSSL
  116. run: swift build
  117. env:
  118. GRPC_NO_NIO_SSL: 1
  119. timeout-minutes: 20
  120. - name: Test without NIOSSL
  121. run: swift test
  122. env:
  123. GRPC_NO_NIO_SSL: 1
  124. timeout-minutes: 20