Skip to content

Commit

Permalink
Update CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Sep 9, 2024
1 parent d9de059 commit a8c4239
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
Expand All @@ -24,28 +24,29 @@ jobs:
python -mpip install .
- name: Test
run: |
pyver="$(python -c 'import sys; print("{0.major}.{0.minor}".format(sys.version_info))')" &&
COVERAGE_FILE=".coverage.$pyver" python -mpytest --cov --cov-branch
python -mpytest --cov --cov-branch
- name: Upload coverage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage
path: .coverage.*
name: coverage-${{ matrix.python-version }}
include-hidden-files: true
path: .coverage

coverage:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Download coverage
uses: actions/download-artifact@v3
with:
name: coverage
python-version: "3.12"
- name: Coverage
run: |
shopt -s globstar &&
GH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
gh run download ${{ github.run-id }} -p 'coverage-*' &&
python -mpip install --upgrade coverage &&
python -mcoverage combine .coverage.* && # Unifies paths across envs.
python -mcoverage combine coverage-* && # Unifies paths across envs.
python -mcoverage annotate &&
( grep -HnTC2 '^!' **/*,cover || true ) &&
python -mcoverage report --show-missing

0 comments on commit a8c4239

Please sign in to comment.