LennardZuendorf commited on
Commit
c2e4a79
1 Parent(s): 049d140

Feat: Added Action to build & lint python app

Browse files
Files changed (1) hide show
  1. .github/workflows/python-app +37 -0
.github/workflows/python-app ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python application
5
+
6
+ on:
7
+ push:
8
+ pull_request:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Set up Python 3.10
21
+ uses: actions/setup-python@v3
22
+ with:
23
+ python-version: "3.10"
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install flake8 pytest
28
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29
+ - name: Lint with flake8
30
+ run: |
31
+ # stop the build if there are Python syntax errors or undefined names
32
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
33
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
34
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
35
+ - name: Test with pytest
36
+ run: |
37
+ pytest