File tree Expand file tree Collapse file tree 4 files changed +72
-2
lines changed Expand file tree Collapse file tree 4 files changed +72
-2
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # Make sure dependencies use compatible licenses.
3+ #
4+ name : License Check
5+
6+ on :
7+ - pull_request
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ timeout-minutes : 30
13+ strategy :
14+ matrix :
15+ python-version : ["3.8"]
16+ steps :
17+ - uses : actions/checkout@v2
18+
19+ - name : Set up Python ${{ matrix.python-version }}
20+ uses : actions/setup-python@v2
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+
24+ - name : Cache dependencies
25+ uses : actions/cache@v2
26+ with :
27+ path : ~/.cache/pip
28+ key : ${{ runner.os }}-lic-${{ hashFiles('**/requirements.txt') }}
29+ restore-keys : |
30+ ${{ runner.os }}-lic-
31+
32+ - name : Install dependencies
33+ run : |
34+ python -m pip install pip
35+ pip install pylic~=2.2
36+ pip install -e .
37+
38+ - name : License check
39+ run : |
40+ pylic check
Original file line number Diff line number Diff line change 1+ #
2+ # Run lint check and static code analysis.
3+ #
14name : Lint
25
36on :
@@ -11,21 +14,34 @@ jobs:
1114 python-version : ["3.8"]
1215 steps :
1316 - uses : actions/checkout@v2
17+
1418 - name : Set up Python ${{ matrix.python-version }}
1519 uses : actions/setup-python@v2
1620 with :
1721 python-version : ${{ matrix.python-version }}
22+
23+ - name : Cache dependencies
24+ uses : actions/cache@v2
25+ with :
26+ path : ~/.cache/pip
27+ key : ${{ runner.os }}-dev-${{ hashFiles('**/requirements.txt') }}
28+ restore-keys : |
29+ ${{ runner.os }}-dev-
30+
1831 - name : Install dependencies
1932 # We install the full dev requirements to make sure everything installs OK
2033 run : |
2134 python -m pip install pip
2235 pip install -e .[dev]
36+
2337 - name : Analysing the code with Black
2438 run : |
2539 black --check .
40+
2641 - name : Analysing the code with mypy
2742 run : |
2843 mypy --install-types --non-interactive ./mindee
44+
2945 - name : Analysing the code with pylint
3046 run : |
3147 pylint ./mindee
Original file line number Diff line number Diff line change 1+ #
2+ # Run unit tests.
3+ #
14name : Test
25
36on :
2730 uses : actions/cache@v2
2831 with :
2932 path : ~/.cache/pip
30- key : ${{ runner.os }}-pip -${{ hashFiles('**/requirements.txt') }}
33+ key : ${{ runner.os }}-test -${{ hashFiles('**/requirements.txt') }}
3134 restore-keys : |
32- ${{ runner.os }}-pip -
35+ ${{ runner.os }}-test -
3336
3437 - name : Install dependencies
3538 run : |
Original file line number Diff line number Diff line change @@ -32,3 +32,14 @@ disable=[
3232 ' consider-using-f-string' ,
3333 ' consider-using-with' ,
3434]
35+
36+ [tool .pylic ]
37+ safe_licenses = [
38+ " Apache Software License" ,
39+ " MIT License" ,
40+ " GNU Library or Lesser General Public License (LGPL)" ,
41+ " Mozilla Public License 2.0 (MPL 2.0)" ,
42+ " BSD License" ,
43+ " Historical Permission Notice and Disclaimer (HPND)" ,
44+ ]
45+ unsafe_packages = [" mindee" ]
You can’t perform that action at this time.
0 commit comments