@@ -36,22 +36,18 @@ jobs:
3636 runs-on : ubuntu-latest
3737 strategy :
3838 fail-fast : false
39- matrix :
40- python_version : ['3.8', '3.9','3.10']
41- env :
42- PYTHON_VERSION : ${{ matrix.python_version }}
4339 steps :
4440 - name : Add custom PYTHONUSERBASE to PATH
4541 run : echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
4642
4743 # Checks out the repository in the current folder.
4844 - name : Checks out repository
49- uses : actions/checkout@v2
45+ uses : actions/checkout@v4
5046
5147 # Set up the right version of Python
5248 - name : Set up Python ${{ env.PYTHON_VERSION }}
5349 id : python
54- uses : actions/setup-python@v2
50+ uses : actions/setup-python@v5
5551 with :
5652 python-version : ${{ env.PYTHON_VERSION }}
5753
6258 #
6359 # Only when the context is exactly the same, we will restore the cache.
6460 - name : Python Dependency Caching
65- uses : actions/cache@v2
61+ uses : actions/cache@v4
6662 id : python_cache
6763 with :
6864 path : ${{ env.PYTHONUSERBASE }}
7268
7369 # Install our dependencies if we did not restore a dependency cache
7470 - name : Install dependencies using poetry
75- if : steps.python_cache.outputs.cache-hit != 'true'
71+ # if: steps.python_cache.outputs.cache-hit != 'true'
7672 run : |
7773 pip install poetry
7874 poetry install --no-interaction --no-ansi
8177 # do create a new environment when our pre-commit setup changes,
8278 # we create a cache key based on relevant factors.
8379 - name : Pre-commit Environment Caching
84- uses : actions/cache@v2
80+ uses : actions/cache@v4
8581 with :
8682 path : ${{ env.PRE_COMMIT_HOME }}
8783 key : " precommit-0-${{ runner.os }}-${{ env.PRE_COMMIT_HOME }}-\
@@ -93,14 +89,14 @@ jobs:
9389 # we set PIP_USER=0 to not do a user install.
9490 - name : Run pre-commit hooks
9591 id : pre-commit
96- run : export PIP_USER=0; SKIP="no-commit-to-branch,black,flake8" pre-commit run --all-files
92+ run : export PIP_USER=0; SKIP="no-commit-to-branch,black,flake8" poetry run pre-commit run --all-files
9793
9894 # Run black seperately as we don't want to reformat the files
9995 # just error if something isn't formatted correctly.
10096 - name : Check files with black
10197 id : black
10298 if : always() && (steps.pre-commit.outcome == 'success' || steps.pre-commit.outcome == 'failure')
103- run : black . --check --diff --color
99+ run : poetry run black . --check --diff --color
104100
105101 # Run flake8 and have it format the linting errors in the format of
106102 # the GitHub Workflow command to register error annotations. This
@@ -113,7 +109,7 @@ jobs:
113109 - name : Run flake8
114110 id : flake8
115111 if : always() && (steps.pre-commit.outcome == 'success' || steps.pre-commit.outcome == 'failure')
116- run : " flake8 \
112+ run : " poetry run flake8 \
117113 --format='::error file=%(path)s,line=%(row)d,col=%(col)d::\
118114 [flake8] %(code)s: %(text)s'"
119115
@@ -132,12 +128,12 @@ jobs:
132128
133129 # Checks out the repository in the current folder.
134130 - name : Checks out repository
135- uses : actions/checkout@v2
131+ uses : actions/checkout@v4
136132
137133 # Set up the right version of Python
138134 - name : Set up Python ${{ env.PYTHON_VERSION }}
139135 id : python
140- uses : actions/setup-python@v2
136+ uses : actions/setup-python@v5
141137 with :
142138 python-version : ${{ env.PYTHON_VERSION }}
143139
@@ -148,7 +144,7 @@ jobs:
148144 #
149145 # Only when the context is exactly the same, we will restore the cache.
150146 - name : Python Dependency Caching
151- uses : actions/cache@v2
147+ uses : actions/cache@v4
152148 id : python_cache
153149 with :
154150 path : ${{ env.PYTHONUSERBASE }}
@@ -158,7 +154,7 @@ jobs:
158154
159155 # Install our dependencies if we did not restore a dependency cache
160156 - name : Install dependencies using poetry
161- if : steps.python_cache.outputs.cache-hit != 'true'
157+ # if: steps.python_cache.outputs.cache-hit != 'true'
162158 run : |
163159 python -m pip install poetry
164160 python -m poetry install --no-interaction --no-ansi
@@ -168,7 +164,7 @@ jobs:
168164 # coverage report to github.
169165 - name : Run tests and generate coverage report
170166 id : run_tests
171- run : python -m pytest tests -n auto --dist loadfile --cov --disable-warnings -q
167+ run : python -m poetry run pytest tests -n auto --dist loadfile --cov --disable-warnings -q
172168
173169 # This step will publish the coverage reports to coveralls.io and
174170 # print a "job" link in the output of the GitHub Action
@@ -183,7 +179,7 @@ jobs:
183179 COVERALLS_FLAG_NAME : coverage-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}
184180 COVERALLS_PARALLEL : true
185181 COVERALLS_SERVICE_NAME : github
186- run : python -m coveralls
182+ run : python -m poetry run coveralls
187183
188184 coveralls-finish :
189185 name : Indicate completion to coveralls.io
@@ -235,7 +231,7 @@ jobs:
235231 - name : Upload a Build Artifact
236232 if : always() && steps.prepare-artifact.outcome == 'success'
237233 continue-on-error : true
238- uses : actions/upload-artifact@v2
234+ uses : actions/upload-artifact@v4
239235 with :
240236 name : pull-request-payload
241237 path : pull_request_payload.json
0 commit comments