Simplified refurb
in CI after #196 fixed mypy
config
#765
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' # pre-commit-ci/lite-action only runs here | |
strategy: | |
matrix: | |
python-version: [3.11, 3.13.0] # Our min and max supported Python versions | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # For setuptools-scm, replace with fetch-tags after https://github.com/actions/checkout/issues/1471 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
- run: echo "UV_PROJECT_ENVIRONMENT=$(python -c "import sysconfig; print(sysconfig.get_config_var('prefix'))")" >> $GITHUB_ENV | |
- run: uv python pin ${{ matrix.python-version }} # uv requires .python-version to match OS Python: https://github.com/astral-sh/uv/issues/11389 | |
- run: uv sync --python-preference only-system | |
- run: git checkout .python-version # For clean git diff given `pre-commit run --show-diff-on-failure` | |
- uses: pre-commit/action@v3.0.1 | |
- uses: pre-commit-ci/lite-action@v1.1.0 | |
if: always() | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.11, 3.13.0] # Our min and max supported Python versions | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # For setuptools-scm, replace with fetch-tags after https://github.com/actions/checkout/issues/1471 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
- run: uv python pin ${{ matrix.python-version }} | |
- name: Check fhaviary build | |
if: matrix.python-version == '3.11' | |
uses: hynek/build-and-inspect-python-package@v2 | |
with: | |
upload-name-suffix: -fhaviary | |
- name: Check aviary.gsm8k build | |
if: matrix.python-version == '3.11' | |
uses: hynek/build-and-inspect-python-package@v2 | |
with: | |
path: packages/gsm8k | |
upload-name-suffix: -gsm8k | |
- name: Check aviary.hotpotqa build | |
if: matrix.python-version == '3.11' | |
uses: hynek/build-and-inspect-python-package@v2 | |
with: | |
path: packages/hotpotqa | |
upload-name-suffix: -hotpotqa | |
- run: uv sync --python-preference=only-managed | |
- run: uv run refurb . | |
- run: uv run pylint src packages | |
- if: matrix.python-version == '3.11' # Only need to run this on one version | |
uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.1.1 | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # For setuptools-scm, replace with fetch-tags after https://github.com/actions/checkout/issues/1471 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
- run: uv sync | |
- name: Login to Hugging Face Hub | |
run: uv run --no-project huggingface-cli login --token $HUGGINGFACE_HUB_ACCESS_TOKEN | |
env: | |
HUGGINGFACE_HUB_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_HUB_ACCESS_TOKEN }} | |
- name: Cache datasets | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/huggingface/datasets | |
key: ${{ runner.os }}-datasets-${{ hashFiles('packages/gsm8k') }}-${{ hashFiles('packages/hotpotqa') }}-${{ hashFiles('packages/litqa') }}-${{ hashFiles('packages/lfrqa') }} | |
restore-keys: ${{ runner.os }}-datasets- | |
- run: uv run pytest -n 16 --dist=loadfile # auto only launches 8 workers in CI, despite runners have 16 cores | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
SEMANTIC_SCHOLAR_API_KEY: ${{ secrets.SEMANTIC_SCHOLAR_API_KEY }} |