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 6a30179
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 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,35 @@ 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
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 &&
for f in **/*,cover; do
if ! grep -q '^!' "$f"; then
continue
fi
echo "$f" &&
grep -nTC2 '^!' "$f"
done &&
python -mcoverage report --show-missing

0 comments on commit 6a30179

Please sign in to comment.