Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #69
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: build_and_test | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
# Only lint in one platform to save compute time | |
linter: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
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 setuptools wheel | |
shell: bash | |
- name: Linter | |
run: | | |
python -m pip install flake8 | |
flake8 . | |
build_and_test: | |
name: Build & Test | |
runs-on: ${{ matrix.platform }} | |
needs: [linter] | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.7, 3.8, 3.9, "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 setuptools wheel | |
python -m pip install --upgrade bump2version twine | |
python -m pip install --upgrade coverage | |
- name: Build | |
run: | | |
python --version | |
python setup.py sdist bdist_wheel | |
twine check dist/*.whl | |
twine check dist/*.tar.gz | |
bump2version --dry-run --verbose --allow-dirty patch | |
bump2version --dry-run --verbose --allow-dirty minor | |
bump2version --dry-run --verbose --allow-dirty major | |
- name: Install pdb-tools | |
run: | | |
python -m pip install . | |
- name: Test on Linux | |
run: | | |
script -q -e -c "coverage run -p setup.py test" | |
shell: bash | |
if: matrix.os == 'ubuntu-latest' | |
- name: Test on MacOS / Windows | |
run: | | |
coverage run -p setup.py test | |
shell: bash | |
if: matrix.os != 'ubuntu-latest' | |
env: | |
SKIP_TTY_TESTS: true | |
# Store coverage data for later | |
# https://hynek.me/articles/ditch-codecov-python/ | |
- name: Store coverage data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-data | |
path: .coverage.* | |
if-no-files-found: ignore | |
retention-days: 2 | |
# Combine and analyze coverage | |
# https://hynek.me/articles/ditch-codecov-python/ | |
coverage: | |
name: Combine & Check coverage. | |
runs-on: ubuntu-latest | |
needs: [build_and_test] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade coverage | |
- name: Download coverage data. | |
uses: actions/[email protected] | |
with: | |
name: coverage-data | |
# We should update the threshold as we write more tests. | |
# It should be the minimum we are comfortable with. | |
- name: Combine coverage & fail if it's < threshold %. | |
run: | | |
python -m coverage combine | |
python -m coverage html --skip-covered --skip-empty | |
python -m coverage report --fail-under=80 | |
- name: Upload HTML report if check failed. | |
uses: actions/upload-artifact@v2 | |
with: | |
name: html-report | |
path: htmlcov | |
if: ${{ failure() }} |