@@ -3,16 +3,20 @@ name: Code analysis
33on :
44 push :
55 branches :
6- - develop
6+ - develop
77 pull_request :
88 branches-ignore :
9- - master
9+ - master
1010 workflow_dispatch :
1111
1212concurrency :
1313 group : ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1414 cancel-in-progress : true
1515
16+ env :
17+ # flake8-commas is failing on Python 3.12
18+ DEFAULT_PYTHON : ' 3.11'
19+
1620jobs :
1721 linters :
1822 name : Linters
@@ -23,41 +27,41 @@ jobs:
2327 security-events : write
2428
2529 steps :
26- - name : Checkout repository
27- uses : actions/checkout@v3
28-
29- - name : Set up Python 3.11
30- uses : actions/setup-python@v4
31- with :
32- python-version : ' 3.11 '
33-
34- - name : Cache pip
35- uses : actions/cache@v3
36- with :
37- path : ~/.cache/pip
38- key : ${{ runner.os }}-python-3.11 -codeql-${{ hashFiles('requirements*.txt') }}
39- restore-keys : |
40- ${{ runner.os }}-python-3.11 -codeql-${{ hashFiles('requirements*.txt') }}
41- ${{ runner.os }}-python-3.11 -codeql-
42- ${{ runner.os }}-python
43- ${{ runner.os }}-
44-
45- - name : Upgrade pip
46- run : python -m pip install --upgrade pip setuptools wheel
47-
48- - name : Install dependencies
49- run : |
50- pip install -I -r requirements-dev.txt
51-
52- # Set the `CODEQL-PYTHON` environment variable to the Python executable
53- # that includes the dependencies
54- echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
55-
56- - name : Run flake8
57- run : python3 -m flake8 --config setup.cfg .
58-
59- - name : Run mypy
60- run : python3 -m mypy --config-file setup.cfg evacuator
30+ - name : Checkout repository
31+ uses : actions/checkout@v4
32+
33+ - name : Set up Python ${{ env.DEFAULT_PYTHON }}
34+ uses : actions/setup-python@v5
35+ with :
36+ python-version : ${{ env.DEFAULT_PYTHON }}
37+
38+ - name : Cache pip
39+ uses : actions/cache@v4
40+ with :
41+ path : ~/.cache/pip
42+ key : ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }} -codeql-${{ hashFiles('requirements*.txt') }}
43+ restore-keys : |
44+ ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }} -codeql-${{ hashFiles('requirements*.txt') }}
45+ ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }} -codeql-
46+ ${{ runner.os }}-python
47+ ${{ runner.os }}-
48+
49+ - name : Upgrade pip
50+ run : python -m pip install --upgrade pip setuptools wheel
51+
52+ - name : Install dependencies
53+ run : |
54+ pip install -I -r requirements-dev.txt
55+
56+ # Set the `CODEQL-PYTHON` environment variable to the Python executable
57+ # that includes the dependencies
58+ echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
59+
60+ - name : Run flake8
61+ run : python3 -m flake8 --config setup.cfg .
62+
63+ - name : Run mypy
64+ run : python3 -m mypy --config-file setup.cfg evacuator
6165
6266 codeql :
6367 name : CodeQL
@@ -68,21 +72,21 @@ jobs:
6872 security-events : write
6973
7074 steps :
71- - name : Checkout repository
72- uses : actions/checkout@v3
75+ - name : Checkout repository
76+ uses : actions/checkout@v4
7377
74- - name : Set up Python 3.11
75- uses : actions/setup-python@v4
76- with :
77- python-version : ' 3.11 '
78+ - name : Set up Python ${{ env.DEFAULT_PYTHON }}
79+ uses : actions/setup-python@v5
80+ with :
81+ python-version : ${{ env.DEFAULT_PYTHON }}
7882
7983 # Initializes the CodeQL tools for scanning.
80- - name : Initialize CodeQL
81- uses : github/codeql-action/init@v2
82- with :
83- languages : python
84-
85- - name : Perform CodeQL Analysis
86- uses : github/codeql-action/analyze@v2
87- with :
88- category : /language:python
84+ - name : Initialize CodeQL
85+ uses : github/codeql-action/init@v3
86+ with :
87+ languages : python
88+
89+ - name : Perform CodeQL Analysis
90+ uses : github/codeql-action/analyze@v3
91+ with :
92+ category : /language:python
0 commit comments