server.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Server build and tests
  2. name: Server
  3. on:
  4. workflow_dispatch: # allows manual triggering
  5. push:
  6. branches:
  7. - master
  8. paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*']
  9. pull_request:
  10. types: [opened, synchronize, reopened]
  11. paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*']
  12. jobs:
  13. server:
  14. runs-on: ubuntu-latest
  15. strategy:
  16. matrix:
  17. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  18. build_type: [Debug, Release]
  19. include:
  20. - build_type: Release
  21. sanitizer: ""
  22. exclude:
  23. - build_type: Release
  24. sanitizer: ADDRESS
  25. - build_type: Release
  26. sanitizer: THREAD
  27. - build_type: Release
  28. sanitizer: UNDEFINED
  29. container:
  30. image: ubuntu:latest
  31. ports:
  32. - 8888
  33. options: --cpus 4
  34. steps:
  35. - name: Clone
  36. id: checkout
  37. uses: actions/checkout@v3
  38. - name: Dependencies
  39. id: depends
  40. run: |
  41. apt-get update
  42. apt-get -y install \
  43. build-essential \
  44. git \
  45. cmake \
  46. python3-pip \
  47. wget \
  48. psmisc
  49. - name: Build
  50. id: cmake_build
  51. run: |
  52. mkdir build
  53. cd build
  54. cmake .. \
  55. -DLLAMA_NATIVE=OFF \
  56. -DLLAMA_BUILD_SERVER=ON \
  57. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
  58. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON ;
  59. cmake --build . --config ${{ matrix.build_type }} -j $(nproc) --target server
  60. - name: Tests dependencies
  61. id: test_dependencies
  62. run: |
  63. pip install -r examples/server/tests/requirements.txt
  64. - name: Download models
  65. id: download_models
  66. run: |
  67. cd examples/server/tests
  68. ../../../scripts/hf.sh --repo ggml-org/models --file tinyllamas/stories260K.gguf
  69. - name: Tests
  70. id: server_integration_test
  71. run: |
  72. cd examples/server/tests
  73. PORT=8888 ./tests.sh