ci.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. name: CI
  2. permissions:
  3. contents: read
  4. on:
  5. push:
  6. branches: ["release/1.x"]
  7. pull_request:
  8. branches: ["release/1.x"]
  9. jobs:
  10. preflight:
  11. name: License Header and Formatting Checks
  12. runs-on: ubuntu-latest
  13. container:
  14. image: swift:6.1
  15. steps:
  16. - name: "Checkout repository"
  17. uses: actions/checkout@v4
  18. - name: Mark the workspace as safe
  19. run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
  20. - name: "Install protoc"
  21. run: apt update && apt install -y protobuf-compiler
  22. - name: "Formatting, License Headers, and Generated Code check"
  23. run: |
  24. ./scripts/sanity.sh
  25. unit-tests:
  26. strategy:
  27. fail-fast: false
  28. matrix:
  29. include:
  30. - image: swift:6.2
  31. swift-build-flags: -c release
  32. - image: swift:6.1
  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.2
  52. swift-version: '6.2'
  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.1
  63. swift-version: '6.1'
  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. name: Performance Tests on ${{ matrix.image }}
  74. runs-on: ubuntu-latest
  75. container:
  76. image: ${{ matrix.image }}
  77. steps:
  78. - uses: actions/checkout@v4
  79. - name: 🧮 Allocation Counting Tests
  80. run: ./Performance/allocations/test-allocation-counts.sh
  81. env: ${{ matrix.env }}
  82. timeout-minutes: 20
  83. integration-tests:
  84. strategy:
  85. fail-fast: false
  86. matrix:
  87. include:
  88. - image: swift:6.2
  89. swift-tools-version: '6.2'
  90. - image: swift:6.1
  91. swift-tools-version: '6.1'
  92. name: Integration Tests on ${{ matrix.image }}
  93. runs-on: ubuntu-latest
  94. container:
  95. image: ${{ matrix.image }}
  96. steps:
  97. - uses: actions/checkout@v4
  98. - name: Install protoc
  99. run: apt update && apt install -y protobuf-compiler
  100. - name: SwiftPM plugin test (v1)
  101. run: ./scripts/run-plugin-tests.sh ${{ matrix.swift-tools-version }} "v1"
  102. - name: Build without NIOSSL
  103. run: swift build
  104. env:
  105. GRPC_NO_NIO_SSL: 1
  106. timeout-minutes: 20
  107. - name: Test without NIOSSL
  108. run: swift test
  109. env:
  110. GRPC_NO_NIO_SSL: 1
  111. timeout-minutes: 20