Revert "test: silence mypy failured due to bad click" #373
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
# Run scriv CI | |
name: "Test Suite" | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
PANDOC_VER: 2.18 | |
jobs: | |
tests: | |
name: "${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: "${{ matrix.os }}-latest" | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu | |
- macos | |
- windows | |
python-version: | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "pypy-3.9" | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v3" | |
- name: "Set up Python" | |
uses: "actions/setup-python@v4" | |
with: | |
python-version: "${{ matrix.python-version }}" | |
cache: pip | |
cache-dependency-path: 'requirements/*.txt' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install -U setuptools | |
python -m pip install -r requirements/tox.txt | |
- name: "Install pandoc on Linux" | |
# sudo apt-get pandoc: will install a version from 2018! | |
if: runner.os == 'Linux' | |
run: | | |
wget -nv -O pandoc.deb https:/jgm/pandoc/releases/download/${PANDOC_VER}/pandoc-${PANDOC_VER}-1-amd64.deb | |
sudo apt install ./pandoc.deb | |
- name: "Install pandoc on Mac" | |
if: runner.os == 'macOS' | |
run: | | |
brew install pandoc | |
- name: "Install pandoc on Windows" | |
if: runner.os == 'Windows' | |
run: | | |
choco install -y -r --no-progress pandoc | |
- name: "Run tox for ${{ matrix.python-version }}" | |
run: | | |
python -m tox | |
- name: "Upload coverage data" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: covdata | |
path: .coverage.* | |
coverage: | |
name: Coverage | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v3" | |
- name: "Set up Python" | |
uses: "actions/setup-python@v4" | |
with: | |
python-version: "3.11" | |
cache: pip | |
cache-dependency-path: 'requirements/*.txt' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install -U setuptools | |
python -m pip install -r requirements/tox.txt | |
- name: "Download coverage data" | |
uses: actions/download-artifact@v3 | |
with: | |
name: covdata | |
- name: "Combine and report" | |
run: | | |
python -m tox -e coverage | |
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | |
echo "total=$TOTAL" >> $GITHUB_ENV | |
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY | |
- name: "Make badge" | |
if: (github.repository == 'nedbat/scriv') && (github.ref == 'refs/heads/main') | |
# https://gist.github.com/nedbat/5a304c1c779d4bcc57be95f847e9327f | |
uses: schneegans/[email protected] | |
with: | |
# GIST_TOKEN is a GitHub personal access token with scope "gist". | |
# https:/settings/tokens/969369418 | |
auth: ${{ secrets.GIST_TOKEN }} | |
gistID: 5a304c1c779d4bcc57be95f847e9327f | |
filename: covbadge.json | |
label: Coverage | |
message: ${{ env.total }}% | |
minColorRange: 50 | |
maxColorRange: 90 | |
valColorRange: ${{ env.total }} | |
docs: | |
name: Docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v3" | |
- name: "Set up Python" | |
uses: "actions/setup-python@v4" | |
with: | |
python-version: "3.7" | |
cache: pip | |
cache-dependency-path: 'requirements/*.txt' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install -U setuptools | |
python -m pip install -r requirements/tox.txt | |
- name: "Build docs" | |
run: | | |
python -m tox -e docs | |
quality: | |
name: Linters etc | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v3" | |
- name: "Set up Python" | |
uses: "actions/setup-python@v4" | |
with: | |
python-version: "3.7" | |
cache: pip | |
cache-dependency-path: 'requirements/*.txt' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install -U setuptools | |
python -m pip install -r requirements/tox.txt | |
- name: "Linters etc" | |
run: | | |
python -m tox -e quality |