Skip to content

Commit

Permalink
Simplify CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Sep 9, 2024
1 parent db695a7 commit b02c955
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
pip list
- 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 --cov-report=xml
python -mpytest --cov --cov-branch
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.flag }}
path: .coverage.*
include-hidden-files: true
path: .coverage

coverage:
runs-on: ubuntu-latest
Expand All @@ -54,16 +54,13 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Download
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Run
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-*/.coverage && # Unifies paths across envs.
python -mcoverage annotate &&
( grep -HnTC2 '^!' **/*,cover || true ) &&
grep -HnTC2 '^!' **/*,cover | sed s/,cover//: &&
python -mcoverage report --show-missing

0 comments on commit b02c955

Please sign in to comment.