Skip to content

Bump actions/setup-python from 4 to 5 #25

Bump actions/setup-python from 4 to 5

Bump actions/setup-python from 4 to 5 #25

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", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
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@v4
with:
name: coverage-data-${{ matrix.python-version }}
path: .coverage.${{ matrix.python-version }}
coverage:
name: Coverage
needs: test
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v4"
- name: Set up Python
uses: "actions/setup-python@v5"
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@v4
with:
pattern: coverage-data-*
merge-multiple: true
- 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