Skip to content

Better, only wrap API responses when a dict #26

Better, only wrap API responses when a dict

Better, only wrap API responses when a dict #26

Workflow file for this run

name: CI
on:
push:
branches: main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
name: Test (Python ${{ matrix.python-version }})
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run tests
run: tox
env:
COVERAGE_FILE: ".coverage.${{ matrix.python-version }}"
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: .coverage.*
coverage:
name: Coverage
needs: test
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
- name: Set up Python
uses: "actions/setup-python@v4"
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage
- name: Download coverage data
uses: actions/download-artifact@v3
with:
name: coverage-data
- name: Report coverage
run: |
python -m coverage combine
python -m coverage report -m --skip-covered
python -m coverage json
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
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: 0926cbcb886804fa2c0fdb68212a367d
filename: coverage-badge.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}