integration.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. name: Integration
  2. on: # yamllint disable-line rule:truthy
  3. push:
  4. branches: ["master"]
  5. pull_request:
  6. branches: ["master"]
  7. permissions:
  8. contents: read
  9. jobs:
  10. python:
  11. name: Python ${{ matrix.python-version }}
  12. runs-on: ubuntu-24.04
  13. strategy:
  14. matrix:
  15. os: [ubuntu-24.04]
  16. python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@v4
  20. - name: Install Ubuntu packages
  21. run: |
  22. sudo ./utils/searxng.sh install packages
  23. - name: Set up Python
  24. uses: actions/setup-python@v5
  25. with:
  26. python-version: ${{ matrix.python-version }}
  27. architecture: 'x64'
  28. - name: Run tests
  29. run: make V=1 ci.test
  30. themes:
  31. name: Themes
  32. runs-on: ubuntu-24.04
  33. steps:
  34. - name: Checkout
  35. uses: actions/checkout@v4
  36. - name: Install Ubuntu packages
  37. run: sudo ./utils/searxng.sh install buildhost
  38. - name: Set up Python
  39. uses: actions/setup-python@v5
  40. with:
  41. python-version: '3.12'
  42. architecture: 'x64'
  43. - name: Build themes
  44. run: make themes.all
  45. dockers:
  46. name: Docker
  47. if: github.ref == 'refs/heads/master'
  48. needs:
  49. - python
  50. - themes
  51. env:
  52. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  53. runs-on: ubuntu-24.04
  54. steps:
  55. - name: Checkout
  56. if: env.DOCKERHUB_USERNAME != null
  57. uses: actions/checkout@v4
  58. with:
  59. # make sure "make docker.push" can get the git history
  60. fetch-depth: '0'
  61. - name: Set up Python
  62. uses: actions/setup-python@v5
  63. with:
  64. python-version: '3.12'
  65. architecture: 'x64'
  66. - name: Cache Python dependencies
  67. id: cache-python
  68. uses: actions/cache@v4
  69. with:
  70. path: |
  71. ./local
  72. ./.nvm
  73. ./node_modules
  74. key: python-ubuntu-20.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
  75. - name: Set up QEMU
  76. if: env.DOCKERHUB_USERNAME != null
  77. uses: docker/setup-qemu-action@v1
  78. - name: Set up Docker Buildx
  79. if: env.DOCKERHUB_USERNAME != null
  80. uses: docker/setup-buildx-action@v1
  81. - name: Login to DockerHub
  82. if: env.DOCKERHUB_USERNAME != null
  83. uses: docker/login-action@v1
  84. with:
  85. username: ${{ secrets.DOCKERHUB_USERNAME }}
  86. password: ${{ secrets.DOCKERHUB_TOKEN }}
  87. - name: Build and push
  88. if: env.DOCKERHUB_USERNAME != null
  89. run: make -e GIT_URL=$(git remote get-url origin) docker.buildx