ci.yaml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: CI
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  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.4-focal
  28. swift-test-flags: "--enable-test-discovery --sanitize=thread"
  29. - image: swift:5.3-focal
  30. swift-build-flags: "--enable-test-discovery"
  31. swift-test-flags: "--enable-test-discovery"
  32. - image: swift:5.2-bionic
  33. swift-build-flags: "--enable-test-discovery"
  34. swift-test-flags: "--enable-test-discovery"
  35. name: Build and Test on ${{ matrix.image }}
  36. runs-on: ubuntu-latest
  37. container:
  38. image: ${{ matrix.image }}
  39. steps:
  40. - uses: actions/checkout@v2
  41. - name: 🔧 Build
  42. run: swift build ${{ matrix.swift-build-flags }}
  43. timeout-minutes: 20
  44. - name: 🧪 Test
  45. run: swift test ${{ matrix.swift-test-flags }}
  46. timeout-minutes: 20
  47. performance-tests:
  48. strategy:
  49. fail-fast: false
  50. matrix:
  51. include:
  52. - image: swift:5.4-focal
  53. env:
  54. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 503000
  55. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 215000
  56. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 112000
  57. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 67000
  58. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 63000
  59. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 204000
  60. - image: swift:5.3-focal
  61. env:
  62. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 504000
  63. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 216000
  64. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 112000
  65. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 67000
  66. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 63000
  67. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 205000
  68. - image: swift:5.2-bionic
  69. env:
  70. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_10_requests: 515000
  71. MAX_ALLOCS_ALLOWED_bidi_1k_rpcs_1_request: 218000
  72. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_10_small_requests: 112000
  73. MAX_ALLOCS_ALLOWED_embedded_server_bidi_1k_rpcs_1_small_request: 67000
  74. MAX_ALLOCS_ALLOWED_embedded_server_unary_1k_rpcs_1_small_request: 63000
  75. MAX_ALLOCS_ALLOWED_unary_1k_ping_pong: 206000
  76. name: Performance Tests on ${{ matrix.image }}
  77. runs-on: ubuntu-latest
  78. container:
  79. image: ${{ matrix.image }}
  80. steps:
  81. - uses: actions/checkout@v2
  82. - name: 🧮 Allocation Counting Tests
  83. run: ./Performance/allocations/test-allocation-counts.sh
  84. env: ${{ matrix.env }}
  85. timeout-minutes: 20