Skip to content

Commit 2c69438

Browse files
committed
update workflows
1 parent 417ea30 commit 2c69438

File tree

2 files changed

+24
-30
lines changed

2 files changed

+24
-30
lines changed

.github/workflows/new_tasks.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
name: Scan for changed tasks
1717
steps:
1818
- name: checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 2 # OR "2" -> To retrieve the preceding commit.
2222

@@ -25,7 +25,7 @@ jobs:
2525
# and prepends the filter name to the standard output names.
2626
- name: Check task folders
2727
id: changed-tasks
28-
uses: tj-actions/changed-files@v46.0.5
28+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62
2929
with:
3030
# tasks checks the tasks folder and api checks the api folder for changes
3131
files_yaml: |
@@ -44,28 +44,24 @@ jobs:
4444
echo "One or more test file(s) has changed."
4545
echo "List of all the files that have changed: ${{ steps.changed-tasks.outputs.tasks_all_modified_files }}"
4646
47-
- name: Set up Python 3.10
47+
- name: Install uv
4848
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
49-
uses: actions/setup-python@v5
49+
uses: astral-sh/setup-uv@v7
5050
with:
51-
python-version: '3.10'
52-
cache: 'pip'
53-
cache-dependency-path: pyproject.toml
51+
enable-cache: true
52+
python-version: "3.10"
5453
- name: Install dependencies
5554
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
5655
run: |
57-
python -m pip install --upgrade pip
58-
pip install -e '.[dev,ifeval,unitxt,math,longbench]' --extra-index-url https://download.pytorch.org/whl/cpu
59-
# Install optional git dependencies
60-
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
61-
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
56+
uv venv
57+
uv pip install -e '.[dev,ifeval,unitxt,math,longbench]' --extra-index-url https://download.pytorch.org/whl/cpu
6258
- name: Test with pytest
6359
# if new tasks are added, run tests on them
6460
if: steps.changed-tasks.outputs.tasks_any_modified == 'true'
65-
run: python -m pytest tests/test_tasks.py -s -vv
61+
run: uv run pytest tests/test_tasks.py -s -vv
6662
# if api is modified, run tests on it
6763
- name: Test more tasks with pytest
6864
env:
6965
API: true
7066
if: steps.changed-tasks.outputs.api_any_modified == 'true'
71-
run: python -m pytest tests/test_tasks.py -s -vv
67+
run: uv run pytest tests/test_tasks.py -s -vv

.github/workflows/unit_tests.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ jobs:
2121

2222
steps:
2323
- name: Checkout Code
24-
uses: actions/checkout@v4
25-
- name: Set up Python 3.10
26-
uses: actions/setup-python@v5
24+
uses: actions/checkout@v6
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v7
2727
with:
28-
python-version: '3.10'
29-
cache: pip
30-
cache-dependency-path: pyproject.toml
28+
enable-cache: true
29+
python-version: "3.10"
3130
- name: Pre-Commit
3231
env:
3332
SKIP: "no-commit-to-branch,mypy"
@@ -43,13 +42,12 @@ jobs:
4342
timeout-minutes: 30
4443
steps:
4544
- name: Checkout Code
46-
uses: actions/checkout@v4
47-
- name: Set up Python ${{ matrix.python-version }}
48-
uses: actions/setup-python@v5
45+
uses: actions/checkout@v6
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v7
4948
with:
49+
enable-cache: true
5050
python-version: ${{ matrix.python-version }}
51-
cache: pip
52-
cache-dependency-path: pyproject.toml
5351

5452
# Cache HuggingFace cache directory for CPU tests
5553
- name: Cache HuggingFace cache (CPU tests)
@@ -63,17 +61,17 @@ jobs:
6361
6462
- name: Install dependencies
6563
run: |
66-
python -m pip install --upgrade pip
67-
pip install -e '.[dev,unitxt]' --extra-index-url https://download.pytorch.org/whl/cpu
68-
pip install hf_xet
64+
uv venv
65+
uv pip install -e '.[dev,unitxt]' --extra-index-url https://download.pytorch.org/whl/cpu
66+
uv pip install hf_xet
6967
7068
- name: Test with pytest
71-
run: python -m pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py
69+
run: uv run pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py
7270
continue-on-error: true # Continue workflow even if tests fail
7371

7472
# Save test artifacts
7573
- name: Archive test artifacts
76-
uses: actions/upload-artifact@v4
74+
uses: actions/upload-artifact@v5
7775
with:
7876
name: output_testcpu${{ matrix.python-version }}
7977
path: |

0 commit comments

Comments
 (0)