server.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. schedule:
  13. - cron: '00 0 * * *'
  14. jobs:
  15. server:
  16. runs-on: ubuntu-latest
  17. strategy:
  18. matrix:
  19. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  20. build_type: [Debug, Release]
  21. include:
  22. - build_type: Release
  23. sanitizer: ""
  24. exclude:
  25. - build_type: Release
  26. sanitizer: ADDRESS
  27. - build_type: Release
  28. sanitizer: THREAD
  29. - build_type: Release
  30. sanitizer: UNDEFINED
  31. container:
  32. image: ubuntu:latest
  33. ports:
  34. - 8888
  35. options: --cpus 4
  36. steps:
  37. - name: Clone
  38. id: checkout
  39. uses: actions/checkout@v3
  40. - name: Dependencies
  41. id: depends
  42. run: |
  43. apt-get update
  44. apt-get -y install \
  45. build-essential \
  46. git \
  47. cmake \
  48. python3-pip \
  49. wget \
  50. psmisc
  51. - name: Build
  52. id: cmake_build
  53. run: |
  54. mkdir build
  55. cd build
  56. cmake .. \
  57. -DLLAMA_NATIVE=OFF \
  58. -DLLAMA_BUILD_SERVER=ON \
  59. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
  60. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON ;
  61. cmake --build . --config ${{ matrix.build_type }} -j $(nproc) --target server
  62. - name: Tests dependencies
  63. id: test_dependencies
  64. run: |
  65. pip install -r examples/server/tests/requirements.txt
  66. - name: Tests
  67. id: server_integration_tests
  68. run: |
  69. cd examples/server/tests
  70. PORT=8888 ./tests.sh
  71. - name: Slow tests
  72. id: server_integration_tests_slow
  73. if: github.event.schedule != ''
  74. run: |
  75. cd examples/server/tests
  76. PORT=8888 ./tests.sh --stop --no-skipped --no-capture --tags slow