integration.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. name: Integration
  2. on:
  3. push:
  4. branches: ["master"]
  5. pull_request:
  6. branches: ["master"]
  7. jobs:
  8. python:
  9. name: Python ${{ matrix.python-version }}
  10. runs-on: ubuntu-20.04
  11. strategy:
  12. matrix:
  13. os: [ubuntu-20.04]
  14. python-version: [3.6, 3.7, 3.8, 3.9]
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v2
  18. - name: Install Ubuntu packages
  19. run: |
  20. sudo ./utils/searx.sh install packages
  21. sudo apt install firefox
  22. - name: Set up Python
  23. uses: actions/setup-python@v2
  24. with:
  25. python-version: ${{ matrix.python-version }}
  26. architecture: 'x64'
  27. - name: Cache Python dependencies
  28. id: cache-python
  29. uses: actions/cache@v2
  30. with:
  31. path: ./local
  32. key: python-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements*.txt', 'setup.py') }}
  33. - name: Install Python dependencies
  34. if: steps.cache-python.outputs.cache-hit != 'true'
  35. run: |
  36. make V=1 install
  37. make V=1 gecko.driver
  38. - name: Run tests
  39. run: make V=1 ci.test
  40. - name: Test coverage
  41. run: make V=1 test.coverage
  42. - name: Store coverage result
  43. uses: actions/upload-artifact@v2
  44. with:
  45. name: coverage-${{ matrix.python-version }}
  46. path: coverage/
  47. retention-days: 60
  48. themes:
  49. name: Themes
  50. runs-on: ubuntu-20.04
  51. steps:
  52. - name: Checkout
  53. uses: actions/checkout@v2
  54. - name: Install Ubuntu packages
  55. run: sudo ./utils/searx.sh install buildhost
  56. - name: Install node dependencies
  57. run: make V=1 node.env
  58. - name: Build themes
  59. run: make V=1 themes.all
  60. documentation:
  61. name: Documentation
  62. runs-on: ubuntu-20.04
  63. steps:
  64. - name: Checkout
  65. uses: actions/checkout@v2
  66. with:
  67. persist-credentials: false
  68. - name: Install Ubuntu packages
  69. run: sudo ./utils/searx.sh install buildhost
  70. - name: Set up Python
  71. uses: actions/setup-python@v2
  72. with:
  73. python-version: '3.9'
  74. architecture: 'x64'
  75. - name: Build documentation
  76. run: |
  77. make V=1 docs.clean docs.html
  78. - name: Deploy
  79. if: github.ref == 'refs/heads/master'
  80. uses: JamesIves/github-pages-deploy-action@3.7.1
  81. with:
  82. GITHUB_TOKEN: ${{ github.token }}
  83. BRANCH: gh-pages
  84. FOLDER: dist/docs
  85. CLEAN: true # Automatically remove deleted files from the deploy branch
  86. SINGLE_COMMIT: True
  87. COMMIT_MESSAGE: build from commit ${{ github.sha }}
  88. babel:
  89. name: Babel
  90. runs-on: ubuntu-20.04
  91. if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
  92. needs:
  93. - python
  94. - themes
  95. - documentation
  96. steps:
  97. - name: Checkout
  98. uses: actions/checkout@v2
  99. with:
  100. persist-credentials: false
  101. - name: Set up Python
  102. uses: actions/setup-python@v2
  103. with:
  104. python-version: '3.9'
  105. architecture: 'x64'
  106. - name: Update transations
  107. id: update
  108. continue-on-error: true
  109. run: |
  110. pip install babel jinja2
  111. searx_extra/update/update_translations.sh
  112. - name: Open pull request
  113. if: steps.update.outcome == 'success'
  114. uses: peter-evans/create-pull-request@v3
  115. with:
  116. commit-message: Update translations (pot, po)
  117. committer: searx-bot <noreply@github.com>
  118. author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
  119. signoff: false
  120. branch: update_translations_pot
  121. delete-branch: true
  122. draft: false
  123. title: 'Update translations (pot, po)'
  124. body: |
  125. Update messages.pot and messages.po files
  126. labels: |
  127. translation
  128. dockers:
  129. name: Docker
  130. if: github.ref == 'refs/heads/master'
  131. needs:
  132. - python
  133. - themes
  134. - documentation
  135. env:
  136. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  137. runs-on: ubuntu-18.04
  138. steps:
  139. - name: Checkout
  140. if: env.DOCKERHUB_USERNAME != null
  141. uses: actions/checkout@v2
  142. with:
  143. # make sure "make docker.push" can get the git history
  144. fetch-depth: '0'
  145. - name: Set up QEMU
  146. if: env.DOCKERHUB_USERNAME != null
  147. uses: docker/setup-qemu-action@v1
  148. - name: Set up Docker Buildx
  149. if: env.DOCKERHUB_USERNAME != null
  150. uses: docker/setup-buildx-action@v1
  151. - name: Login to DockerHub
  152. if: env.DOCKERHUB_USERNAME != null
  153. uses: docker/login-action@v1
  154. with:
  155. username: ${{ secrets.DOCKERHUB_USERNAME }}
  156. password: ${{ secrets.DOCKERHUB_TOKEN }}
  157. - name: Build and push
  158. if: env.DOCKERHUB_USERNAME != null
  159. run: make -e GIT_URL=$(git remote get-url origin) docker.buildx