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 a732221
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 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,36 @@ 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
ls -a
- 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 a732221

Please sign in to comment.