Skip to content

Commit 619fe40

Browse files
authored
chg: 👷 check for compatible licenses in CI (#42)
1 parent 2128ef0 commit 619fe40

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed

.github/workflows/license.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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

.github/workflows/linting.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#
2+
# Run lint check and static code analysis.
3+
#
14
name: Lint
25

36
on:
@@ -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

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#
2+
# Run unit tests.
3+
#
14
name: Test
25

36
on:
@@ -27,9 +30,9 @@ jobs:
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: |

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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"]

0 commit comments

Comments
 (0)