-
-
Notifications
You must be signed in to change notification settings - Fork 311
55 lines (43 loc) · 1.42 KB
/
ci.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
name: CI
on: [push, pull_request]
env:
CI: true
PIPENV_VENV_IN_PROJECT: true
AUTOTHROTTLE_MAX_DELAY: 30.0
AUTOTHROTTLE_START_DELAY: 1.5
AUTOTHROTTLE_TARGET_CONCURRENCY: 3.0
jobs:
check:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Pipenv
uses: dschep/install-pipenv-action@v1
- name: Install dependencies
run: pipenv sync --dev
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
- name: Check imports with isort
run: pipenv run isort . --check-only
- name: Check style with black
run: pipenv run black . --check
- name: Lint with flake8
run: pipenv run flake8 .
- name: Test with pytest
run: pipenv run pytest
- name: Validate output with scrapy
if: github.event_name == 'pull_request'
run: |
git checkout ${{ github.base_ref }}
git checkout $(git show-ref | grep pull | awk '{ print $2 }')
git diff-index --name-only --diff-filter=d $(git merge-base HEAD ${{ github.base_ref }}) | \
grep -Pio '(?<=/spiders/).*(?=\.py)' | \
xargs pipenv run scrapy validate