-
Notifications
You must be signed in to change notification settings - Fork 49
106 lines (86 loc) · 2.64 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Tests
on:
pull_request:
push:
# trying and staging branches are for BORS config
branches:
- trying
- staging
- main
jobs:
linter:
name: linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pipenv
run: pipx install pipenv
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pipenv"
- name: Install dependencies
run: pipenv install --dev
- name: Linter with pylint
run: pipenv run pylint scraper
unit_tests:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
name: unit-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Chromium
run: sudo apt-get update && sudo apt-get install -y chromium-browser chromium-chromedriver
- name: Install pipenv
run: pipx install pipenv
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pipenv"
- name: Install dependencies
run: pipenv install --dev
- name: Run tests
run: pipenv run pytest
integration_tests:
env:
MEILISEARCH_HOST_URL: "http://127.0.0.1:7700"
MEILISEARCH_API_KEY: "masterKey"
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
name: integration-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pipenv
run: pipx install pipenv
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pipenv"
- name: Install dependencies for production only
run: pipenv install
- name: Meilisearch setup with Docker
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --no-analytics --master-key=masterKey
- name: Run the scraper with basic config
run: pipenv run ./docs_scraper $CONFIG_FILE
env:
CONFIG_FILE: "tests/config_files_examples/docs-basics.config.json"
- name: Run the scraper with custom config
run: pipenv run ./docs_scraper $CONFIG_FILE
env:
CONFIG_FILE: "tests/config_files_examples/docs-custom.config.json"
image_build:
name: image-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: docker build .