ci.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.2
  29. swift-build-flags: -c release
  30. - image: swift:6.1
  31. swift-build-flags: -c release
  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@v4
  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:6.2
  50. swift-version: '6.2'
  51. env:
  52. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  53. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  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: 163000
  58. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  59. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  60. - image: swift:6.1
  61. swift-version: '6.1'
  62. env:
  63. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 323000
  64. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 161000
  65. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 110000
  66. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 65000
  67. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 61000
  68. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 163000
  69. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_client: 170000
  70. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong_interceptors_server: 170000
  71. name: Performance Tests on ${{ matrix.image }}
  72. runs-on: ubuntu-latest
  73. container:
  74. image: ${{ matrix.image }}
  75. steps:
  76. - uses: actions/checkout@v4
  77. - name: 🧮 Allocation Counting Tests
  78. run: ./Performance/allocations/test-allocation-counts.sh
  79. env: ${{ matrix.env }}
  80. timeout-minutes: 20
  81. integration-tests:
  82. strategy:
  83. fail-fast: false
  84. matrix:
  85. include:
  86. - image: swift:6.2
  87. swift-tools-version: '6.2'
  88. - image: swift:6.1
  89. swift-tools-version: '6.1'
  90. name: Integration Tests on ${{ matrix.image }}
  91. runs-on: ubuntu-latest
  92. container:
  93. image: ${{ matrix.image }}
  94. steps:
  95. - uses: actions/checkout@v4
  96. - name: Install protoc
  97. run: apt update && apt install -y protobuf-compiler
  98. - name: SwiftPM plugin test (v1)
  99. run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v1"
  100. - name: Build without NIOSSL
  101. run: swift build
  102. env:
  103. GRPC_NO_NIO_SSL: 1
  104. timeout-minutes: 20
  105. - name: Test without NIOSSL
  106. run: swift test
  107. env:
  108. GRPC_NO_NIO_SSL: 1
  109. timeout-minutes: 20