Skip to content

ci: re-enable pytest, splitting offline tests from live ones #15

ci: re-enable pytest, splitting offline tests from live ones

ci: re-enable pytest, splitting offline tests from live ones #15

Workflow file for this run

name: Pytest
on:
pull_request:
branches:
- main
- dev
permissions:
contents: read
jobs:
offline:
# Deterministic tests with no Yahoo access.
runs-on: ubuntu-latest
steps:
- name: Checkout code
# Verify: curl -s "https://api.github.com/repos/actions/checkout/commits?sha=v7&until=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')&per_page=1" | jq -r '.[0].sha'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
# Verify: curl -s "https://api.github.com/repos/astral-sh/setup-uv/commits?sha=v9.0.0&until=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')&per_page=1" | jq -r '.[0].sha'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "latest"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Python
run: uv python install 3.12
- name: Create virtual environment
run: uv venv
- name: Install dependencies
run: uv pip install -e ".[dev]"
- name: Run offline tests
run: uv run pytest -m "not network"