Skip to content

diff cov with targer branch #140

diff cov with targer branch

diff cov with targer branch #140

Workflow file for this run

name: check
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
latest-python-version: 3.13
jobs:
py-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: UV cache
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-${{ matrix.python-version }}-uv-${{ hashFiles('pyproject.toml') }}
- name: Install UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Run tests
run: uv run project.py cov --no-report
- name: Upload coverage
if: matrix.python-version == env.latest-python-version
uses: actions/upload-artifact@v4
with:
name: coverage-xml
include-hidden-files: true
path: ${{ github.workspace }}/coverage.xml
py-coverage:
runs-on: ubuntu-latest
needs: py-tests
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 50 }
- name: UV cache
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
- name: Download target coverage
uses: dawidd6/action-download-artifact@v6
with:
branch: ${{ github.event.pull_request.base.ref }}
name: coverage-xml
path: coverage-target
if_no_artifact_found: warn
- name: Download current coverage
uses: actions/download-artifact@v4
with:
name: coverage-xml
- run: git fetch origin main
- name: Install UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Check coverage
run: |
uv run project.py cov
--no-test
--target-xml=${{ github.workspace }}/coverage-target/coverage.xml
py-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: UV cache
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
- name: Install UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Check lint
run: uv run project.py lint
py-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: UV cache
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
- name: Install UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Check lint
run: uv build