1
0

server.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # Server build and tests
  2. name: Server
  3. on:
  4. workflow_dispatch: # allows manual triggering
  5. inputs:
  6. sha:
  7. description: 'Commit SHA1 to build'
  8. required: false
  9. type: string
  10. slow_tests:
  11. description: 'Run slow tests'
  12. required: true
  13. type: boolean
  14. push:
  15. branches:
  16. - master
  17. paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'tools/server/**.*']
  18. pull_request:
  19. types: [opened, synchronize, reopened]
  20. paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'tools/server/**.*']
  21. env:
  22. LLAMA_LOG_COLORS: 1
  23. LLAMA_LOG_PREFIX: 1
  24. LLAMA_LOG_TIMESTAMPS: 1
  25. LLAMA_LOG_VERBOSITY: 10
  26. concurrency:
  27. group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
  28. cancel-in-progress: true
  29. jobs:
  30. server:
  31. runs-on: ubuntu-latest
  32. strategy:
  33. matrix:
  34. sanitizer: [ADDRESS, UNDEFINED] # THREAD is broken
  35. build_type: [RelWithDebInfo]
  36. include:
  37. - build_type: Release
  38. sanitizer: ""
  39. fail-fast: false # While -DLLAMA_SANITIZE_THREAD=ON is broken
  40. steps:
  41. - name: Dependencies
  42. id: depends
  43. run: |
  44. sudo apt-get update
  45. sudo apt-get -y install \
  46. build-essential \
  47. xxd \
  48. git \
  49. cmake \
  50. curl \
  51. wget \
  52. language-pack-en \
  53. libssl-dev
  54. - name: Clone
  55. id: checkout
  56. uses: actions/checkout@v4
  57. with:
  58. fetch-depth: 0
  59. ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
  60. - name: Python setup
  61. id: setup_python
  62. uses: actions/setup-python@v5
  63. with:
  64. python-version: '3.11'
  65. - name: Tests dependencies
  66. id: test_dependencies
  67. run: |
  68. pip install -r tools/server/tests/requirements.txt
  69. server-windows:
  70. runs-on: windows-2022
  71. steps:
  72. - name: Clone
  73. id: checkout
  74. uses: actions/checkout@v4
  75. with:
  76. fetch-depth: 0
  77. ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
  78. - name: Build
  79. id: cmake_build
  80. run: |
  81. cmake -B build -DLLAMA_CURL=OFF -DLLAMA_BUILD_BORINGSSL=ON
  82. cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS} --target llama-server
  83. - name: Python setup
  84. id: setup_python
  85. uses: actions/setup-python@v5
  86. with:
  87. python-version: '3.11'
  88. - name: Tests dependencies
  89. id: test_dependencies
  90. run: |
  91. pip install -r tools/server/tests/requirements.txt
  92. - name: Tests
  93. id: server_integration_tests
  94. if: ${{ !matrix.disabled_on_pr || !github.event.pull_request }}
  95. run: |
  96. cd tools/server/tests
  97. $env:PYTHONIOENCODING = ":replace"
  98. pytest -v -x -m "not slow"
  99. - name: Slow tests
  100. id: server_integration_tests_slow
  101. if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }}
  102. run: |
  103. cd tools/server/tests
  104. $env:SLOW_TESTS = "1"
  105. pytest -v -x