on master help sign in
[mod] use github actions instead of travis

fix https://github.com/searx/searx/issues/2279

commit9c25cd99c4b2bbeeb96f0a4efc3b2c21b06e1881 authorAlexandre Flament <alex@al-f.net> dateMon 16 Nov 2020, 15:01 (6 years ago) parenta30d9f2
5 files changed+114−92
.coveragerc+1−10 .github/workflows/integration.yml+110 .travis.yml−77 requirements.txt+1−1 tests/unit/test_standalone_searx.py+2−4
.coveragerc+1−10
@@ -1,15 +1,6 @@
11[run]
22branch = True
3−source =
4− searx/engines
5− searx/__init__.py
6− searx/autocomplete.py
7− searx/https_rewrite.py
8− searx/languages.py
9− searx/search.py
10− searx/testing.py
11− searx/utils.py
12− searx/webapp.py
3+source = searx
134
145[report]
156show_missing = True
.github/workflows/integration.ymlnew file+110
@@ -0,0 +1,110 @@
1+name: Integration
2+
3+on: [push, pull_request]
4+
5+jobs:
6+ python:
7+ name: Python ${{ matrix.python-version }}
8+ runs-on: ubuntu-latest
9+ strategy:
10+ matrix:
11+ os: [ubuntu-latest]
12+ python-version: [3.5, 3.6, 3.7, 3.8]
13+ steps:
14+ - name: Checkout 🛎️
15+ uses: actions/checkout@v2
16+ - name: Install Ubuntu packages 🧰
17+ run: |
18+ sudo ./utils/searx.sh install packages
19+ sudo apt install firefox
20+ - name: Set up Python 🧰
21+ uses: actions/setup-python@v2
22+ with:
23+ python-version: ${{ matrix.python-version }}
24+ architecture: 'x64'
25+ - name: Install Python dependencies 🧰
26+ run: |
27+ make V=1 install
28+ make V=1 gecko.driver
29+ - name: Run tests 🏗️
30+ run: make V=1 test
31+ - name: Test coverage 🗺️
32+ run: make V=1 test.coverage
33+ - name: Store coverage result 🗺️
34+ uses: actions/upload-artifact@v2
35+ with:
36+ name: coverage-${{ matrix.python-version }}
37+ path: coverage/
38+ retention-days: 60
39+
40+ themes:
41+ name: Themes
42+ runs-on: ubuntu-latest
43+ steps:
44+ - name: Checkout 🛎️
45+ uses: actions/checkout@v2
46+ - name: Install Ubuntu packages 🧰
47+ run: sudo ./utils/searx.sh install packages
48+ - name: Install node dependencies 🧰
49+ run: make V=1 node.env
50+ - name: Build themes 🏗️
51+ run: make V=1 themes
52+
53+ documentation:
54+ name: Documentation
55+ runs-on: ubuntu-latest
56+ steps:
57+ - name: Checkout 🛎️
58+ uses: actions/checkout@v2
59+ with:
60+ persist-credentials: false
61+ - name: Install Ubuntu packages 🧰
62+ run: sudo ./utils/searx.sh install buildhost
63+ - name: Set up Python 🧰
64+ uses: actions/setup-python@v2
65+ with:
66+ python-version: '3.9'
67+ architecture: 'x64'
68+ - name: Build documentation 🏗️
69+ run: SEARX_DEBUG=1 make V=1 travis-gh-pages
70+ - name: Deploy 🚀
71+ if: github.ref == 'ref/head/master'
72+ uses: JamesIves/github-pages-deploy-action@e774cc50ed6e8e667bca6a331d2a3ba80c79debc
73+ with:
74+ GITHUB_TOKEN: ${{ github.token }}
75+ BRANCH: gh-pages
76+ FOLDER: gh-pages
77+ CLEAN: true # Automatically remove deleted files from the deploy branch
78+
79+ dockers:
80+ name: Docker
81+ if: github.ref == 'ref/head/master'
82+ needs:
83+ - python
84+ - themes
85+ - documentation
86+ env:
87+ DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
88+ runs-on: ubuntu-latest
89+ steps:
90+ - name: Checkout 🛎️
91+ if: env.DOCKERHUB_USERNAME != null
92+ uses: actions/checkout@v2
93+ with:
94+ # make sure "make docker.push" can get the git history
95+ fetch-depth: '0'
96+ - name: Set up QEMU 🧰
97+ if: env.DOCKERHUB_USERNAME != null
98+ uses: docker/setup-qemu-action@v1
99+ - name: Set up Docker Buildx 🧰
100+ if: env.DOCKERHUB_USERNAME != null
101+ uses: docker/setup-buildx-action@v1
102+ - name: Login to DockerHub 🔒
103+ if: env.DOCKERHUB_USERNAME != null
104+ uses: docker/login-action@v1
105+ with:
106+ username: ${{ secrets.DOCKERHUB_USERNAME }}
107+ password: ${{ secrets.DOCKERHUB_TOKEN }}
108+ - name: Build and push 🐳
109+ if: env.DOCKERHUB_USERNAME != null
110+ run: make -e GIT_URL=$(git remote get-url origin) docker.push
.travis.ymldeleted−77
@@ -1,77 +0,0 @@
1−os: linux
2−dist: bionic
3−language: python
4−cache:
5− - directories:
6− - $HOME/.cache/pip
7−addons:
8− firefox: "latest"
9−
10−install:
11− - env
12− - which python; python --version
13− - make V=1 install
14− - make V=1 gecko.driver
15− - make V=1 node.env
16− - make V=1 travis.codecov
17−script:
18− - make V=1 themes
19− - make V=1 test
20−after_success:
21− - make V=1 test.coverage
22− - codecov
23−
24−stages:
25− - test
26− - name: documentation
27− if: env(GITHUB_TOKEN) IS present
28− - name: docker
29− if: branch = master AND type != pull_request AND env(DOCKER_USERNAME) IS present
30−
31−jobs:
32− include:
33− - python: "3.5"
34− - python: "3.6"
35− - python: "3.7"
36− - python: "3.8"
37− - stage: documentation
38− python: "3.8"
39− addons: []
40− before_install:
41− - sudo ./utils/searx.sh install buildhost
42− install: true
43− script:
44− - SEARX_DEBUG=1 make travis-gh-pages
45− after_success: true
46− deploy:
47− provider: pages
48− edge: false
49− token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
50− strategy: git
51− skip_cleanup: true
52− keep_history: true
53− local_dir: gh-pages
54− target_branch: gh-pages
55− on:
56− branch: master
57− - stage: docker
58− python: "3.8"
59− git:
60− depth: false
61− services:
62− - docker
63− addons: []
64− before_install: true
65− install: true
66− script:
67− - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
68− - make -e GIT_URL=$(git remote get-url origin) docker.push
69− after_success: true
70−
71−notifications:
72− irc:
73− channels:
74− - "irc.freenode.org#searx"
75− template:
76− - "%{repository}/#%{build_number}/%{branch} (%{author}): %{message} %{build_url}"
77− on_success: change
requirements.txt+1−1
@@ -4,7 +4,7 @@ flask-babel==1.0.0
44flask==1.1.2
55idna==2.10
66jinja2==2.11.1
7−lxml==4.5.0
7+lxml==4.6.1
88pygments==2.1.3
99pyopenssl==19.1.0
1010python-dateutil==2.8.0
tests/unit/test_standalone_searx.py+2−4
@@ -28,8 +28,7 @@ class StandaloneSearx(SearxTestCase):
2828
2929 @classmethod
3030 def setUpClass(cls):
31− engine_list = [{'engine': 'dummy', 'name': 'engine1', 'shortcut': 'e1'},
32− {'engine': 'dummy', 'name': 'engine2', 'shortcut': 'e2'}]
31+ engine_list = [{'engine': 'dummy', 'name': 'engine1', 'shortcut': 'e1'}]
3332
3433 initialize_engines(engine_list)
3534
@@ -103,8 +102,7 @@ class StandaloneSearx(SearxTestCase):
103102 args = sas.parse_argument(['rain', ])
104103 search_q = sas.get_search_query(args)
105104 self.assertTrue(search_q)
106− self.assertEqual(search_q, SearchQuery('rain', [EngineRef('engine1', 'general', False),
107− EngineRef('engine2', 'general', False)],
105+ self.assertEqual(search_q, SearchQuery('rain', [EngineRef('engine1', 'general', False)],
108106 ['general'], 'all', 0, 1, None, None, None))
109107
110108 def test_no_parsed_url(self):