server.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Server build and tests
  2. name: Server
  3. on:
  4. workflow_dispatch: # allows manual triggering
  5. inputs:
  6. slow_tests:
  7. description: 'Run slow tests'
  8. required: true
  9. type: boolean
  10. push:
  11. branches:
  12. - master
  13. paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*']
  14. pull_request:
  15. types: [opened, synchronize, reopened]
  16. paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/tests/**.*']
  17. schedule:
  18. - cron: '0 0 * * *'
  19. jobs:
  20. server:
  21. runs-on: ubuntu-latest
  22. strategy:
  23. matrix:
  24. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  25. build_type: [Debug, Release]
  26. include:
  27. - build_type: Release
  28. sanitizer: ""
  29. exclude:
  30. - build_type: Release
  31. sanitizer: ADDRESS
  32. - build_type: Release
  33. sanitizer: THREAD
  34. - build_type: Release
  35. sanitizer: UNDEFINED
  36. container:
  37. image: ubuntu:latest
  38. ports:
  39. - 8888
  40. options: --cpus 4
  41. steps:
  42. - name: Clone
  43. id: checkout
  44. uses: actions/checkout@v3
  45. - name: Dependencies
  46. id: depends
  47. run: |
  48. apt-get update
  49. apt-get -y install \
  50. build-essential \
  51. git \
  52. cmake \
  53. python3-pip \
  54. wget \
  55. psmisc \
  56. language-pack-en
  57. - name: Build
  58. id: cmake_build
  59. run: |
  60. mkdir build
  61. cd build
  62. cmake .. \
  63. -DLLAMA_NATIVE=OFF \
  64. -DLLAMA_BUILD_SERVER=ON \
  65. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
  66. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON ;
  67. cmake --build . --config ${{ matrix.build_type }} -j $(nproc) --target server
  68. - name: Tests dependencies
  69. id: test_dependencies
  70. run: |
  71. pip install -r examples/server/tests/requirements.txt
  72. - name: Tests
  73. id: server_integration_tests
  74. run: |
  75. cd examples/server/tests
  76. PORT=8888 ./tests.sh
  77. - name: Slow tests
  78. id: server_integration_tests_slow
  79. if: ${{ github.event.schedule != '' && matrix.build_type == 'Release' || github.event.inputs.slow_tests == 'true' }}
  80. run: |
  81. cd examples/server/tests
  82. PORT=8888 ./tests.sh --stop --no-skipped --no-capture --tags slow