-
Notifications
You must be signed in to change notification settings - Fork 7
43 lines (34 loc) · 1.37 KB
/
main.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
name: PIRLib Actions
on:
push:
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install --progress-bar off pytest==5.1.3 pytest-cov==3.0.0
pip install --progress-bar off flake8==3.9.2 black==22.3.0
- name: Format check with Black
run: |
black --line-length 100 --check pirlib/ tests/
- name: Lint with flake8
run: |
# Stop if there are Python syntax errors or undefined names
flake8 pirlib/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Ignore C901 (Function is too complex), W503 (Line break occurred before a binary operator), and E203 (Whitespace before ':')
flake8 pirlib/ tests/ --ignore C901,W503,E203 --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
- name: Install PirLib
run: pip install --progress-bar off .
- name: Install example dependencies
run: pip install -r examples/multi_backends/requirements.txt
- name: Test with pytest
run: |
python -m pytest -s -v --cov=pirlib --cov-branch --cov-report term-missing tests pirlib