From a73222142d77ad48caa00ff64e5823c2d6972535 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 20 Aug 2024 11:11:02 +0200 Subject: [PATCH] Update CI. --- .github/workflows/build.yml | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec3a3dc..32bd13e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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