Skip to content

Project setup

Project setup #4

Workflow file for this run

name: Python library
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
UV_SYSTEM_PYTHON: 1
jobs:
lint:
runs-on: ubuntu-latest
env:
MYPY_CACHE_DIR: "${{ github.workspace }}/.cache/mypy"
RUFF_CACHE_DIR: "${{ github.workspace }}/.cache/ruff"
PRE_COMMIT_HOME: "${{ github.workspace }}/.cache/pre-commit"
steps:
- uses: actions/checkout@v4
- name: Set up Python and dependencies
uses: ./.github/actions/python-deps
with:
pythonVersion: "3.11"
- name: Cache pre-commit tools
uses: actions/cache@v4
with:
path: |
${{ env.MYPY_CACHE_DIR }}
${{ env.RUFF_CACHE_DIR }}
${{ env.PRE_COMMIT_HOME }}
key: ${{ hashFiles('requirements-dev.txt', '.pre-commit-config.yaml') }}-linter-cache
- name: Run pre-commit checks
run: pre-commit run --all-files --verbose --show-diff-on-failure
test:
name: Test jobs-infra on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up oldest supported Python on ${{ matrix.os }}
uses: ./.github/actions/python-deps
with:
pythonVersion: "3.10"
- name: Execute python tests
run: |
uv pip install . # need to install without --no-deps to work around non-portable dependency resolution in `uv pip compile`
pytest