ci.yaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. - image: swift:6.0-jammy
  30. - image: swift:5.10.1-noble
  31. name: Build and Test on ${{ matrix.image }}
  32. runs-on: ubuntu-latest
  33. container:
  34. image: ${{ matrix.image }}
  35. steps:
  36. - uses: actions/checkout@v4
  37. - name: 🔧 Build
  38. run: swift build ${{ matrix.swift-build-flags }}
  39. timeout-minutes: 20
  40. - name: 🧪 Test
  41. run: swift test ${{ matrix.swift-test-flags }}
  42. timeout-minutes: 20
  43. performance-tests:
  44. strategy:
  45. fail-fast: false
  46. matrix:
  47. include:
  48. - image: swift:6.1
  49. swift-version: '6.1'
  50. env:
  51. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  52. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  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: 163000
  57. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  58. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  59. - image: swift:6.0-jammy
  60. swift-version: '6.0'
  61. env:
  62. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  63. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  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: 163000
  68. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  69. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  70. - image: swift:5.10.1-noble
  71. swift-version: '5.10'
  72. env:
  73. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  74. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  75. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  76. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  77. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  78. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  79. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  80. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  81. name: Performance Tests on ${{ matrix.image }}
  82. runs-on: ubuntu-latest
  83. container:
  84. image: ${{ matrix.image }}
  85. steps:
  86. - uses: actions/checkout@v4
  87. - name: 🧮 Allocation Counting Tests
  88. run: ./Performance/allocations/test-allocation-counts.sh
  89. env: ${{ matrix.env }}
  90. timeout-minutes: 20
  91. integration-tests:
  92. strategy:
  93. fail-fast: false
  94. matrix:
  95. include:
  96. - image: swift:6.1
  97. swift-tools-version: '6.1'
  98. - image: swift:6.0-jammy
  99. swift-tools-version: '6.0'
  100. - image: swift:5.10.1-noble
  101. swift-tools-version: '5.10'
  102. name: Integration Tests on ${{ matrix.image }}
  103. runs-on: ubuntu-latest
  104. container:
  105. image: ${{ matrix.image }}
  106. steps:
  107. - uses: actions/checkout@v4
  108. - name: Install protoc
  109. run: apt update && apt install -y protobuf-compiler
  110. - name: SwiftPM plugin test (v1)
  111. run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v1"
  112. - name: Build without NIOSSL
  113. run: swift build
  114. env:
  115. GRPC_NO_NIO_SSL: 1
  116. timeout-minutes: 20
  117. - name: Test without NIOSSL
  118. run: swift test
  119. env:
  120. GRPC_NO_NIO_SSL: 1
  121. timeout-minutes: 20