Skip to content

Commit 8ea052c

Browse files
Create python-package.yml
1 parent 9d2cd06 commit 8ea052c

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches:
9+
- 'master'
10+
- 'release/**'
11+
- 'hotfix/**'
12+
- 'develop'
13+
pull_request:
14+
branches:
15+
- 'master'
16+
- 'release/**'
17+
- 'hotfix/**'
18+
- 'develop'
19+
20+
jobs:
21+
build:
22+
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v3
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
python -m pip install flake8 pytest
39+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
40+
- name: Lint with flake8
41+
run: |
42+
# stop the build if there are Python syntax errors or undefined names
43+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
44+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
45+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
46+
- name: Test with pytest
47+
run: |
48+
pytest

0 commit comments

Comments
 (0)