@@ -240,47 +240,48 @@ in the [Collaborative Git lesson](https://coderefinery.github.io/git-collaborati
240240
241241 ```{code-block} yaml
242242 ---
243- emphasize-lines: 16,29,39-45
243+ emphasize-lines: 14,30,40-46
244244 ---
245- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
245+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
246246 # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
247247
248- name: Python package
248+ name: Test
249249
250250 on:
251251 push:
252252 branches: [ "main" ]
253253 pull_request:
254254 branches: [ "main" ]
255255
256+ permissions:
257+ contents: read
258+ pull-requests: write
259+
256260 jobs:
257261 build:
258- permissions:
259- contents: read
260- pull-requests: write
261262
262263 runs-on: ubuntu-latest
263264
264265 steps:
265- - uses: actions/checkout@v3
266+ - uses: actions/checkout@v4
266267 - name: Set up Python 3.10
267268 uses: actions/setup-python@v3
268269 with:
269270 python-version: "3.10"
270271 - name: Install dependencies
271272 run: |
272273 python -m pip install --upgrade pip
273- python -m pip install flake8 pytest pytest-cov
274+ pip install flake8 pytest pytest-cov
274275 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
275276 - name: Lint with flake8
276277 run: |
277278 # stop the build if there are Python syntax errors or undefined names
278279 flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
279280 # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
280281 flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
281- - name: Test with pytest and calculate coverage
282+ - name: Test with pytest
282283 run: |
283- pytest --cov-report "xml:coverage.xml" --cov=.
284+ pytest --cov-report "xml:coverage.xml" --cov=.
284285 - name: Create Coverage
285286 if: ${{ github.event_name == 'pull_request' }}
286287 uses: orgoro/coverage@v3
0 commit comments