1- # This workflow will install Python dependencies, run tests and lint with a single version of Python
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41name : Python application
52
63on :
7- push :
8- branches : [ "master" ]
9- pull_request :
10- branches : [ "master" ]
4+ - pull_request
5+ - push
116
127permissions :
138 contents : read
149
1510jobs :
1611 build :
12+ name : ${{ matrix.python-version }}
1713
18- runs-on : ubuntu-latest
1914 env :
2015 ID_INSTANCE : ${{ secrets.ID_INSTANCE }}
2116 API_TOKEN_INSTANCE : ${{ secrets.API_TOKEN_INSTANCE }}
17+
18+ runs-on : ${{ matrix.os }}
19+ strategy :
20+ matrix :
21+ os :
22+ - ubuntu-latest
23+ python-version :
24+ - " 3.7"
25+ - " 3.8"
26+ - " 3.9"
27+ - " 3.10"
28+
2229 steps :
23- - uses : actions/checkout@v3
24- - name : Set up Python 3.10
25- uses : actions/setup-python@v3
26- with :
27- python-version : " 3.10"
28- - name : Install dependencies
29- run : |
30- python -m pip install --upgrade pip
31- pip install flake8 pytest
32- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33- - name : Lint with flake8
34- run : |
35- # stop the build if there are Python syntax errors or undefined names
36- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39- - name : Test with pytest
40- run : |
41- pytest
30+ - uses : actions/checkout@v3
31+ - name : Set up Python ${{ matrix.python-version }}
32+ uses : actions/setup-python@v4
33+ with :
34+ python-version : ${{ matrix.python-version }}
35+ - name : Install dependencies
36+ run : |
37+ python -m pip install --upgrade pip
38+ pip install flake8 pytest
39+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
40+ - name : Lint with flake8
41+ run : |
42+ python${{ matrix.python-version }} -m flake8 --extend-ignore E999 .
43+ - name : Test with pytest
44+ run : |
45+ pytest
0 commit comments