ci.yaml 4.2 KB

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