Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions .github/workflows/new_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Scan for changed tasks
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 2 # OR "2" -> To retrieve the preceding commit.

Expand All @@ -25,7 +25,7 @@ jobs:
# and prepends the filter name to the standard output names.
- name: Check task folders
id: changed-tasks
uses: tj-actions/changed-files@v46.0.5
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62
with:
# tasks checks the tasks folder and api checks the api folder for changes
files_yaml: |
Expand All @@ -44,28 +44,24 @@ jobs:
echo "One or more test file(s) has changed."
echo "List of all the files that have changed: ${{ steps.changed-tasks.outputs.tasks_all_modified_files }}"

- name: Set up Python 3.10
- name: Install uv
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v7
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: pyproject.toml
enable-cache: true
python-version: "3.10"
activate-environment: true
- name: Install dependencies
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
run: |
python -m pip install --upgrade pip
pip install -e '.[dev,ifeval,unitxt,math,longbench]' --extra-index-url https://download.pytorch.org/whl/cpu
# Install optional git dependencies
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
uv pip install -e '.[dev,ifeval,unitxt,math,longbench,hf]' --extra-index-url https://download.pytorch.org/whl/cpu
- name: Test with pytest
# if new tasks are added, run tests on them
if: steps.changed-tasks.outputs.tasks_any_modified == 'true'
run: python -m pytest tests/test_tasks.py -s -vv
run: pytest -x -s -vv tests/test_tasks.py
# if api is modified, run tests on it
- name: Test more tasks with pytest
env:
API: true
if: steps.changed-tasks.outputs.api_any_modified == 'true'
run: python -m pytest tests/test_tasks.py -s -vv
run: pytest -x -s -vv -n=auto tests/test_tasks.py
35 changes: 18 additions & 17 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: '3.10'
cache: pip
cache-dependency-path: pyproject.toml
enable-cache: true
python-version: "3.10"
activate-environment: true
- name: Install pip
run: uv pip install pip
- name: Pre-Commit
env:
SKIP: "no-commit-to-branch,mypy"
Expand All @@ -43,13 +45,13 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
activate-environment: true

# Cache HuggingFace cache directory for CPU tests
- name: Cache HuggingFace cache (CPU tests)
Expand All @@ -63,17 +65,16 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev,unitxt]' --extra-index-url https://download.pytorch.org/whl/cpu
pip install hf_xet
uv pip install -e '.[dev,unitxt,hf]' --extra-index-url https://download.pytorch.org/whl/cpu
uv pip install hf_xet

- name: Test with pytest
run: python -m pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py
continue-on-error: true # Continue workflow even if tests fail
run: pytest -x --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py --ignore=tests/scripts/test_zeno_visualize.py

# Save test artifacts
- name: Archive test artifacts
uses: actions/upload-artifact@v4
if: always() # Upload artifacts even if tests fail
uses: actions/upload-artifact@v5
with:
name: output_testcpu${{ matrix.python-version }}
path: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ examples/wandb/

# PyInstaller
*.spec

#uv
uv.lock
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- id: mixed-line-ending
args: [ --fix=lf ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.2
rev: v0.14.6
hooks:
# Run the linter.
- id: ruff-check
Expand All @@ -46,7 +46,7 @@ repos:

args: [ --check-filenames, --check-hidden, --ignore-words=ignore.txt ]
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.32
rev: v0.9.33
hooks:
- id: pymarkdown
exclude: ^(lm_eval/tasks/.*|docs/footguns\.md)$
Expand Down
Loading
Loading