-
Notifications
You must be signed in to change notification settings - Fork 14
51 lines (50 loc) · 1.95 KB
/
python.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
name: Check and test both packages
on: [push, pull_request]
jobs:
check-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
package: [decred, tinywallet]
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 pip
run: |
python -m pip install --upgrade pip
- name: Install the poetry tool
run: |
pip install poetry
- name: Install the ${{ matrix.package }} package and its dependencies
working-directory: ${{ format('./{0}/', matrix.package) }}
run: |
poetry install
- name: Lint the ${{ matrix.package }} code with black
working-directory: ${{ format('./{0}/', matrix.package) }}
run: |
# stop the build if the code was not reformatted by black
poetry run black --check --diff .
- name: Sort ${{ matrix.package }} import lines with isort
working-directory: ${{ format('./{0}/', matrix.package) }}
run: |
# stop the build if import lines were not sorted by isort
poetry run isort --check-only --diff --recursive .
- name: Lint the ${{ matrix.package }} code with flake8
working-directory: ${{ format('./{0}/', matrix.package) }}
run: |
# stop the build if there are syntax errors or undefined names
poetry run flake8 --select=E9,F63,F7,F82 --show-source .
# exit-zero treats all errors as warnings
poetry run flake8 --ignore=E203,E221,E261,E731,W503 --exit-zero .
- name: Test the ${{ matrix.package }} package with pytest
working-directory: ${{ format('./{0}/', matrix.package) }}
run: |
poetry run pytest ./tests/unit/
# - name: Build the ${{ matrix.package }} package
# working-directory: ${{ format('./{0}/', matrix.package) }}
# run: |
# poetry build