ci.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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:6.0-jammy
  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. ./dev/sanity.sh
  23. unit-tests:
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. include:
  28. - image: swiftlang/swift:nightly-jammy
  29. # No TSAN because of: https://github.com/apple/swift/issues/59068
  30. # swift-test-flags: "--sanitize=thread"
  31. - image: swift:6.0-jammy
  32. # No TSAN because of: https://github.com/apple/swift/issues/59068
  33. # swift-test-flags: "--sanitize=thread"
  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: swiftlang/swift:nightly-jammy
  52. swift-version: 'main'
  53. - image: swift:6.0-jammy
  54. swift-version: '6.0'
  55. name: Performance Tests on ${{ matrix.image }}
  56. runs-on: ubuntu-latest
  57. container:
  58. image: ${{ matrix.image }}
  59. steps:
  60. - uses: actions/checkout@v4
  61. - name: Install jemalloc for benchmarking
  62. run: apt update && apt-get install -y libjemalloc-dev
  63. timeout-minutes: 20
  64. - name: Run Benchmarks
  65. working-directory: "./IntegrationTests/Benchmarks"
  66. run: swift package benchmark baseline check --no-progress --check-absolute-path Thresholds/${{ matrix.swift-version }}/
  67. timeout-minutes: 20
  68. examples:
  69. strategy:
  70. fail-fast: false
  71. matrix:
  72. include:
  73. - image: swiftlang/swift:nightly-jammy
  74. - image: swift:6.0-jammy
  75. name: Build examples using ${{ matrix.image }}
  76. runs-on: ubuntu-latest
  77. container:
  78. image: ${{ matrix.image }}
  79. steps:
  80. - uses: actions/checkout@v4
  81. - name: Build examples
  82. run: ./dev/build-examples.sh