Skip to content

Commit c278c8a

Browse files
committed
👷 add github actions
1 parent d129594 commit c278c8a

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/check_pr.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Check the source code
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
jobs:
7+
Format:
8+
name: Format
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-python@v4
13+
with:
14+
python-version: "3.10"
15+
- run: pip install pipenv
16+
- run: pipenv install --dev --skip-lock
17+
- run: pipenv run black --check src/ && pipenv run isort --check src/
18+
- run: pipenv run black --check test/ && pipenv run isort --check test/
19+
Lint:
20+
name: Lint
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-python@v4
25+
with:
26+
python-version: "3.10"
27+
- run: pip install pipenv
28+
- run: pipenv install --dev --skip-lock
29+
- run: pipenv run flake8 src/ && pipenv run mypy src/
30+
- run: pipenv run flake8 test/ && pipenv run mypy test/
31+
Test:
32+
name: Test
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
python-version: ["3.8", "3.9", "3.10"]
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
- run: pip install pipenv
43+
- run: pipenv install --dev --skip-lock
44+
- run: pipenv run pytest --cov=src test/

0 commit comments

Comments
 (0)