integration.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. babel:
  46. name: Update translations branch
  47. runs-on: ubuntu-24.04
  48. if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
  49. needs:
  50. - python
  51. - themes
  52. permissions:
  53. contents: write # for make V=1 weblate.push.translations
  54. steps:
  55. - name: Checkout
  56. uses: actions/checkout@v4
  57. with:
  58. fetch-depth: '0'
  59. token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
  60. - name: Set up Python
  61. uses: actions/setup-python@v5
  62. with:
  63. python-version: '3.12'
  64. architecture: 'x64'
  65. - name: Cache Python dependencies
  66. id: cache-python
  67. uses: actions/cache@v4
  68. with:
  69. path: |
  70. ./local
  71. ./.nvm
  72. ./node_modules
  73. key: python-ubuntu-20.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
  74. - name: weblate & git setup
  75. env:
  76. WEBLATE_CONFIG: ${{ secrets.WEBLATE_CONFIG }}
  77. run: |
  78. mkdir -p ~/.config
  79. echo "${WEBLATE_CONFIG}" > ~/.config/weblate
  80. git config --global user.email "searxng-bot@users.noreply.github.com"
  81. git config --global user.name "searxng-bot"
  82. - name: Update transations
  83. id: update
  84. run: |
  85. make V=1 weblate.push.translations
  86. dockers:
  87. name: Docker
  88. if: github.ref == 'refs/heads/master'
  89. needs:
  90. - python
  91. - themes
  92. env:
  93. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  94. runs-on: ubuntu-24.04
  95. steps:
  96. - name: Checkout
  97. if: env.DOCKERHUB_USERNAME != null
  98. uses: actions/checkout@v4
  99. with:
  100. # make sure "make docker.push" can get the git history
  101. fetch-depth: '0'
  102. - name: Set up Python
  103. uses: actions/setup-python@v5
  104. with:
  105. python-version: '3.12'
  106. architecture: 'x64'
  107. - name: Cache Python dependencies
  108. id: cache-python
  109. uses: actions/cache@v4
  110. with:
  111. path: |
  112. ./local
  113. ./.nvm
  114. ./node_modules
  115. key: python-ubuntu-20.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
  116. - name: Set up QEMU
  117. if: env.DOCKERHUB_USERNAME != null
  118. uses: docker/setup-qemu-action@v1
  119. - name: Set up Docker Buildx
  120. if: env.DOCKERHUB_USERNAME != null
  121. uses: docker/setup-buildx-action@v1
  122. - name: Login to DockerHub
  123. if: env.DOCKERHUB_USERNAME != null
  124. uses: docker/login-action@v1
  125. with:
  126. username: ${{ secrets.DOCKERHUB_USERNAME }}
  127. password: ${{ secrets.DOCKERHUB_TOKEN }}
  128. - name: Build and push
  129. if: env.DOCKERHUB_USERNAME != null
  130. run: make -e GIT_URL=$(git remote get-url origin) docker.buildx