build(deps): bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #155
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ubuntu 20.04 | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 setuptools wheel pytest coverage | |
pip install . | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
run: pytest -v | |
- name: Run coverage | |
run: coverage run -m pytest src tests | |
env: | |
COVERAGE_FILE: ".coverage.${{ matrix.python-version }}" | |
- name: Store coverage file | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage | |
path: .coverage.${{ matrix.python-version }} | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v4.1.7 | |
id: download | |
with: | |
name: 'coverage' | |
- name: Coverage comment | |
id: coverage_comment | |
uses: ewjoachim/python-coverage-comment-action@v2 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MERGE_COVERAGE_FILES: true | |
- name: Store Pull Request comment to be posted | |
uses: actions/upload-artifact@v2 | |
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | |
with: | |
name: python-coverage-comment-action | |
path: python-coverage-comment-action.txt |