integration.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. name: Integration
  2. on: [push, pull_request]
  3. jobs:
  4. python:
  5. name: Python ${{ matrix.python-version }}
  6. runs-on: ubuntu-latest
  7. strategy:
  8. matrix:
  9. os: [ubuntu-latest]
  10. python-version: [3.5, 3.6, 3.7, 3.8]
  11. steps:
  12. - name: Checkout 🛎️
  13. uses: actions/checkout@v2
  14. - name: Install Ubuntu packages 🧰
  15. run: |
  16. sudo ./utils/searx.sh install packages
  17. sudo apt install firefox
  18. - name: Set up Python 🧰
  19. uses: actions/setup-python@v2
  20. with:
  21. python-version: ${{ matrix.python-version }}
  22. architecture: 'x64'
  23. - name: Install Python dependencies 🧰
  24. run: |
  25. make V=1 install
  26. make V=1 gecko.driver
  27. - name: Run tests 🏗️
  28. run: make V=1 test
  29. - name: Test coverage 🗺️
  30. run: make V=1 test.coverage
  31. - name: Store coverage result 🗺️
  32. uses: actions/upload-artifact@v2
  33. with:
  34. name: coverage-${{ matrix.python-version }}
  35. path: coverage/
  36. retention-days: 60
  37. themes:
  38. name: Themes
  39. runs-on: ubuntu-latest
  40. steps:
  41. - name: Checkout 🛎️
  42. uses: actions/checkout@v2
  43. - name: Install Ubuntu packages 🧰
  44. run: sudo ./utils/searx.sh install packages
  45. - name: Install node dependencies 🧰
  46. run: make V=1 node.env
  47. - name: Build themes 🏗️
  48. run: make V=1 themes
  49. documentation:
  50. name: Documentation
  51. runs-on: ubuntu-latest
  52. steps:
  53. - name: Checkout 🛎️
  54. uses: actions/checkout@v2
  55. with:
  56. persist-credentials: false
  57. - name: Install Ubuntu packages 🧰
  58. run: sudo ./utils/searx.sh install buildhost
  59. - name: Set up Python 🧰
  60. uses: actions/setup-python@v2
  61. with:
  62. python-version: '3.9'
  63. architecture: 'x64'
  64. - name: Build documentation 🏗️
  65. run: SEARX_DEBUG=1 make V=1 travis-gh-pages
  66. - name: Deploy 🚀
  67. if: github.ref == 'ref/head/master'
  68. uses: JamesIves/github-pages-deploy-action@e774cc50ed6e8e667bca6a331d2a3ba80c79debc
  69. with:
  70. GITHUB_TOKEN: ${{ github.token }}
  71. BRANCH: gh-pages
  72. FOLDER: gh-pages
  73. CLEAN: true # Automatically remove deleted files from the deploy branch
  74. dockers:
  75. name: Docker
  76. if: github.ref == 'ref/head/master'
  77. needs:
  78. - python
  79. - themes
  80. - documentation
  81. env:
  82. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  83. runs-on: ubuntu-latest
  84. steps:
  85. - name: Checkout 🛎️
  86. if: env.DOCKERHUB_USERNAME != null
  87. uses: actions/checkout@v2
  88. with:
  89. # make sure "make docker.push" can get the git history
  90. fetch-depth: '0'
  91. - name: Set up QEMU 🧰
  92. if: env.DOCKERHUB_USERNAME != null
  93. uses: docker/setup-qemu-action@v1
  94. - name: Set up Docker Buildx 🧰
  95. if: env.DOCKERHUB_USERNAME != null
  96. uses: docker/setup-buildx-action@v1
  97. - name: Login to DockerHub 🔒
  98. if: env.DOCKERHUB_USERNAME != null
  99. uses: docker/login-action@v1
  100. with:
  101. username: ${{ secrets.DOCKERHUB_USERNAME }}
  102. password: ${{ secrets.DOCKERHUB_TOKEN }}
  103. - name: Build and push 🐳
  104. if: env.DOCKERHUB_USERNAME != null
  105. run: make -e GIT_URL=$(git remote get-url origin) docker.push