integration.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 packages
  56. - name: Install node dependencies
  57. run: make V=1 node.env
  58. - name: Build themes
  59. run: make V=1 themes
  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: SEARX_DEBUG=1 make V=1 ci-gh-pages
  77. - name: Deploy
  78. if: github.ref == 'refs/heads/master'
  79. uses: JamesIves/github-pages-deploy-action@3.7.1
  80. with:
  81. GITHUB_TOKEN: ${{ github.token }}
  82. BRANCH: gh-pages
  83. FOLDER: build/gh-pages
  84. CLEAN: true # Automatically remove deleted files from the deploy branch
  85. dockers:
  86. name: Docker
  87. if: github.ref == 'refs/heads/master'
  88. needs:
  89. - python
  90. - themes
  91. - documentation
  92. env:
  93. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  94. runs-on: ubuntu-18.04
  95. steps:
  96. - name: Checkout
  97. if: env.DOCKERHUB_USERNAME != null
  98. uses: actions/checkout@v2
  99. with:
  100. # make sure "make docker.push" can get the git history
  101. fetch-depth: '0'
  102. - name: Set up QEMU
  103. if: env.DOCKERHUB_USERNAME != null
  104. uses: docker/setup-qemu-action@v1
  105. - name: Set up Docker Buildx
  106. if: env.DOCKERHUB_USERNAME != null
  107. uses: docker/setup-buildx-action@v1
  108. - name: Login to DockerHub
  109. if: env.DOCKERHUB_USERNAME != null
  110. uses: docker/login-action@v1
  111. with:
  112. username: ${{ secrets.DOCKERHUB_USERNAME }}
  113. password: ${{ secrets.DOCKERHUB_TOKEN }}
  114. - name: Build and push
  115. if: env.DOCKERHUB_USERNAME != null
  116. run: make -e GIT_URL=$(git remote get-url origin) docker.push