44 push :
55 branches :
66 - main
7+ - develop
78 paths :
89 - " **.py"
910 - " **.pyi"
11+ - " .github/workflows/lint-python.yml"
12+ - " scripts/requirements*.txt"
1013 pull_request :
1114 branches :
1215 - main
1316 - develop
1417 paths :
1518 - " **.py"
1619 - " **.pyi"
20+ - " .github/workflows/lint-python.yml"
21+ - " scripts/requirements*.txt"
1722
1823env :
24+ # https://help.pythonanywhere.com/pages/ChangingSystemImage/#available-python-versions-for-system-images
1925 python-version : " 3.10"
26+ # https://help.pythonanywhere.com/pages/ChangingSystemImage/#base-ubuntu-version-for-each-system-image
27+ # runs-on: "ubuntu-20.04"
2028
2129jobs :
30+ # Jobs that don't need dependencies installed
2231 isort :
23- runs-on : ubuntu-latest
32+ runs-on : " ubuntu-20.04 "
2433 steps :
2534 - name : Checkout ${{ github.repository }}/${{ github.ref }}
2635 uses : actions/checkout@v3
@@ -29,15 +38,11 @@ jobs:
2938 with :
3039 python-version : ${{ env.python-version }}
3140 cache : " pip"
32- cache-dependency-path : " scripts/requirements*.txt"
33- - name : Install dependencies
34- run : |
35- pip install wheel
36- pip install -r "scripts/requirements.txt"
37- - name : Analysing the code with ${{ job.name }}
38- run : isort backend/ typings/ --check-only
41+ cache-dependency-path : " scripts/requirements-dev.txt"
42+ - run : pip install isort
43+ - run : isort backend/ typings/ --check-only
3944 add-trailing-comma :
40- runs-on : ubuntu-latest
45+ runs-on : " ubuntu-20.04 "
4146 steps :
4247 - name : Checkout ${{ github.repository }}/${{ github.ref }}
4348 uses : actions/checkout@v3
@@ -46,12 +51,11 @@ jobs:
4651 with :
4752 python-version : ${{ env.python-version }}
4853 cache : " pip"
49- cache-dependency-path : " scripts/requirements* .txt"
54+ cache-dependency-path : " scripts/requirements-dev .txt"
5055 - run : pip install add-trailing-comma
51- - name : Analysing the code with ${{ job.name }}
52- run : add-trailing-comma $(git ls-files '**.py*') --py36-plus
56+ - run : add-trailing-comma $(git ls-files '**.py*') --py36-plus
5357 Bandit :
54- runs-on : ubuntu-latest
58+ runs-on : " ubuntu-20.04 "
5559 steps :
5660 - name : Checkout ${{ github.repository }}/${{ github.ref }}
5761 uses : actions/checkout@v3
@@ -60,13 +64,13 @@ jobs:
6064 with :
6165 python-version : ${{ env.python-version }}
6266 cache : " pip"
63- cache-dependency-path : " scripts/requirements* .txt"
67+ cache-dependency-path : " scripts/requirements-dev .txt"
6468 - run : pip install bandit
65- - run : mv backend/configs.template.py backend/configs.py
66- - name : Analysing the code with ${{ job.name }}
67- run : bandit -n 1 --severity-level medium --recursive backend
69+ - run : bandit -n 1 --severity-level medium --recursive backend
70+
71+ # Jobs that do need dependencies installed
6872 Pyright :
69- runs-on : ubuntu-latest
73+ runs-on : " ubuntu-20.04 "
7074 steps :
7175 - name : Checkout ${{ github.repository }}/${{ github.ref }}
7276 uses : actions/checkout@v3
@@ -79,15 +83,14 @@ jobs:
7983 - name : Install dependencies
8084 run : |
8185 pip install wheel
82- pip install -r "scripts/requirements.txt"
86+ pip install -r "scripts/requirements-dev .txt"
8387 - run : mv backend/configs.template.py backend/configs.py
84- - name : Analysing the code with ${{ job.name }}
85- uses : jakebailey/pyright-action@v1
88+ - uses : jakebailey/pyright-action@v1
8689 with :
8790 working-directory : backend/
8891 extra-args : --warnings
8992 Pylint :
90- runs-on : ubuntu-latest
93+ runs-on : " ubuntu-20.04 "
9194 steps :
9295 - name : Checkout ${{ github.repository }}/${{ github.ref }}
9396 uses : actions/checkout@v3
@@ -100,12 +103,11 @@ jobs:
100103 - name : Install dependencies
101104 run : |
102105 pip install wheel
103- pip install -r "scripts/requirements.txt"
106+ pip install -r "scripts/requirements-dev .txt"
104107 - run : mv backend/configs.template.py backend/configs.py
105- - name : Analysing the code with ${{ job.name }}
106- run : pylint backend/ --reports=y --output-format=colorized
108+ - run : pylint backend/ --reports=y --output-format=colorized
107109 Flake8 :
108- runs-on : ubuntu-latest
110+ runs-on : " ubuntu-20.04 "
109111 steps :
110112 - name : Checkout ${{ github.repository }}/${{ github.ref }}
111113 uses : actions/checkout@v3
@@ -114,11 +116,6 @@ jobs:
114116 with :
115117 python-version : ${{ env.python-version }}
116118 cache : " pip"
117- cache-dependency-path : " scripts/requirements*.txt"
118- - name : Install dependencies
119- run : |
120- pip install wheel
121- pip install -r "scripts/requirements.txt"
122- - run : mv backend/configs.template.py backend/configs.py
123- - name : Analysing the code with ${{ job.name }}
124- run : flake8 backend/ typings/
119+ cache-dependency-path : " scripts/requirements-dev.txt"
120+ - run : pip install -r "scripts/requirements-dev.txt"
121+ - run : flake8 backend/ typings/
0 commit comments