Skip to content

Commit 23ed8b1

Browse files
committed
update workflows
1 parent 417ea30 commit 23ed8b1

File tree

2 files changed

+25
-30
lines changed

2 files changed

+25
-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"
53+
activate-environment: true
5454
- name: Install dependencies
5555
if: steps.changed-tasks.outputs.tasks_any_modified == 'true' || steps.changed-tasks.outputs.api_any_modified == 'true'
5656
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
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 python -m pytest tests/test_tasks.py -s -vv

.github/workflows/unit_tests.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ 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"
30+
activate-environment: true
3131
- name: Pre-Commit
3232
env:
3333
SKIP: "no-commit-to-branch,mypy"
@@ -43,13 +43,13 @@ jobs:
4343
timeout-minutes: 30
4444
steps:
4545
- name: Checkout Code
46-
uses: actions/checkout@v4
47-
- name: Set up Python ${{ matrix.python-version }}
48-
uses: actions/setup-python@v5
46+
uses: actions/checkout@v6
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v7
4949
with:
50+
enable-cache: true
5051
python-version: ${{ matrix.python-version }}
51-
cache: pip
52-
cache-dependency-path: pyproject.toml
52+
activate-environment: true
5353

5454
# Cache HuggingFace cache directory for CPU tests
5555
- name: Cache HuggingFace cache (CPU tests)
@@ -63,17 +63,16 @@ jobs:
6363
6464
- name: Install dependencies
6565
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
66+
uv pip install -e '.[dev,unitxt]' --extra-index-url https://download.pytorch.org/whl/cpu
67+
uv pip install hf_xet
6968
7069
- 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
70+
run: uv run pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py
7271
continue-on-error: true # Continue workflow even if tests fail
7372

7473
# Save test artifacts
7574
- name: Archive test artifacts
76-
uses: actions/upload-artifact@v4
75+
uses: actions/upload-artifact@v5
7776
with:
7877
name: output_testcpu${{ matrix.python-version }}
7978
path: |

0 commit comments

Comments
 (0)