👷 Move from pytest-cov to coverage and Codecov to Smokeshow (#483)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent 1e43c6b · Browse files · 8 files·+84 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
8 files+84 added−13 removed
- other:+84 added−13 removed
Provenance
- Commit
b988f6f- Tree
1cac0b7- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
1e43c6b
8 files changed+84 added−13 removed
added:.github/workflows/smokeshow.yml+35 added
1234567891011121314151617181920212223242526272829303132333435name: Smokeshow
on: workflow_run: workflows: [Test] types: [completed]
permissions: statuses: write
jobs: smokeshow: if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest
steps: - uses: actions/setup-python@v4 with: python-version: '3.9'
- run: pip install smokeshow
- uses: dawidd6/action-download-artifact@v2 with: workflow: test.yml commit: ${{ github.event.workflow_run.head_sha }}
- run: smokeshow upload coverage-html env: SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage} SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100 SMOKESHOW_GITHUB_CONTEXT: coverage SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }} SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}modified:.github/workflows/test.yml+38 added-3 removed
23 unmodified lines24252627282829303132333435363738393839404142434445464748495051525354555657585960616263646566676869707172737423 unmodified lines python-version: ${{ matrix.python-version }} - name: Install Flit run: pip install flit - name: Install Dependencies # run: flit install --deps=develop --symlink run: python -m pip install ".[test]" - name: Install Click 7 if: matrix.click-7 run: pip install "click<8.0.0" - name: Lint if: ${{ matrix.python-version != '3.6' && matrix.click-7 == false }} run: bash scripts/lint.sh - run: mkdir coverage - name: Test run: bash scripts/test.sh - name: Upload coverage uses: codecov/codecov-action@v3 env: COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} - name: Store coverage files uses: actions/upload-artifact@v3 with: name: coverage path: coverage coverage-combine: needs: [test] runs-on: ubuntu-latest
steps: - uses: actions/checkout@v3
- uses: actions/setup-python@v4 with: python-version: '3.8'
- name: Get coverage files uses: actions/download-artifact@v3 with: name: coverage path: coverage
- run: pip install coverage[toml]
- run: ls -la coverage - run: coverage combine coverage - run: coverage report - run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
- name: Store coverage HTML uses: actions/upload-artifact@v3 with: name: coverage-html path: htmlcovmodified:docs/index.md+2 added-3 removed
9 unmodified lines10 </a>11 <a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">12 <img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">13 </a>14-<a href="https://codecov.io/gh/tiangolo/typer" target="_blank">15- <img src="https://img.shields.io/codecov/c/github/tiangolo/typer?color=%2334D058" alt="Coverage">16-</a>14+<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">15+ <img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">16 <a href="https://pypi.org/project/typer" target="_blank">17 <img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">18 </a>19 </p>307 unmodified linesmodified:scripts/test-cov-html.sh+4 added-1 removed
1234566789#!/usr/bin/env bash
set -eset -x
bash scripts/test.sh --cov-report=html ${@}bash scripts/test.sh ${@}coverage combinecoverage report --show-missingcoverage htmlmodified:scripts/test.sh+1 added-1 removed
7 unmodified lines89101112127 unmodified lines# Force disable terminal for tests inside of pytest, takes precedence over GITHUB_ACTIONS env varexport _TYPER_FORCE_DISABLE_TERMINAL=1bash ./scripts/test-files.sh# Use xdist-pytest --forked to ensure modified sys.path to import relative modules in examples keeps workingpytest --cov=typer --cov=tests --cov=docs_src --cov-report=term-missing --cov-report=xml -o console_output_style=progress --forked --numprocesses=auto ${@}coverage run -m pytest -o console_output_style=progress --forked --numprocesses=auto ${@}modified:.coveragerc+1 added
4 unmodified lines5 tests6 docs_src7 8 parallel = True9+context = '${CONTEXT}'modified:pyproject.toml+1 added-2 removed
37 unmodified lines383940414243424344454629 unmodified lines37 unmodified lines[tool.flit.metadata.requires-extra]test = [ "shellingham >=1.3.0,<2.0.0", "pytest >=4.4.0,<5.4.0", "pytest-cov >=2.10.0,<3.0.0", "coverage >=5.2,<6.0", "coverage >=5.2,<7.0", "pytest-xdist >=1.32.0,<2.0.0", "pytest-sugar >=0.9.4,<0.10.0", "mypy ==0.910", "black >=22.3.0,<23.0.0",29 unmodified linesmodified:README.md+2 added-3 removed
9 unmodified lines10 </a>11 <a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">12 <img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">13 </a>14-<a href="https://codecov.io/gh/tiangolo/typer" target="_blank">15- <img src="https://img.shields.io/codecov/c/github/tiangolo/typer?color=%2334D058" alt="Coverage">16-</a>14+<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">15+ <img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">16 <a href="https://pypi.org/project/typer" target="_blank">17 <img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">18 </a>19 </p>307 unmodified lines