Skip to content

better gh actions

better gh actions #128

Workflow file for this run

on:
push:
branches: [main]
pull_request:
branches: [main]
env:
latest-python-version: 3.13
jobs:
check-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@v3
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
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: ${{ github.workspace }}/.coverage
include-hidden-files: true
check-py-coverage:
runs-on: ubuntu-latest
needs: check-py-tests
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 50 }
- name: UV cache
uses: actions/cache@v3
with:
path: ~/.cache/uv
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
- name: Download coverage
uses: actions/download-artifact@v4
with:
name: coverage-3.12
- 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
check-py-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: UV cache
uses: actions/cache@v3
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
check-py-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: UV cache
uses: actions/cache@v3
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