Skip to content

Commit 08f94af

Browse files
authored
Create python-package.yml
1 parent d327c2f commit 08f94af

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python package
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11"]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install pipenv
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install pipenv
29+
30+
- name: Install dependencies with pipenv
31+
run: |
32+
pipenv --python ${{ matrix.python-version }} sync --dev && pipenv clean
33+
34+
- name: Lint with flake8
35+
run: |
36+
# stop the build if there are Python syntax errors or undefined names
37+
pipenv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39+
pipenv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
41+
- name: Test with pytest
42+
run: |
43+
pipenv run python -m pytest tests -rP

0 commit comments

Comments
 (0)