-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 2745240.
- Loading branch information
Showing
2 changed files
with
49 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
# just comment out unwanted steps to turn off the test. | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
|
@@ -7,39 +11,38 @@ on: | |
branches: | ||
- 'main' | ||
workflow_dispatch: | ||
|
||
# Jobs run concurrently and steps run sequentially within a job. | ||
# jobs: linter and cpu_tests. Add more jobs/steps as required. | ||
jobs: | ||
linter: | ||
name: Linters | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "latest" | ||
enable-cache: true | ||
- name: Install dependencies and run pre-commit | ||
python-version: 3.9 | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
- name: Pre-Commit | ||
env: | ||
SKIP: "no-commit-to-branch,mypy" | ||
run: | | ||
uv pip install pre-commit --system | ||
pre-commit run --all-files | ||
|
||
uses: pre-commit/[email protected] | ||
# # mypy turned off for now | ||
# - name: Lint with mypy | ||
# run: mypy . --ignore-missing-imports --check-untyped-defs --explicit-package-bases --warn-unreachable | ||
# Job 2 | ||
testcpu: | ||
name: CPU Tests | ||
runs-on: ubuntu-latest | ||
env: | ||
UV_SYSTEM_PYTHON: 1 | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
python-version: ["3.9", "3.10", "3.11", "3.12" ] | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout Code | ||
|
@@ -48,15 +51,15 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
enable-cache: true | ||
cache-dependency-glob: "**/pyproject.toml" | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
- name: Install dependencies | ||
run: | | ||
uv pip install -e '.[dev,sentencepiece,api]' --extra-index-url https://download.pytorch.org/whl/cpu --system | ||
python -m pip install --upgrade pip | ||
pip install -e '.[dev,sentencepiece,api]' --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 | ||
- name: Test with pytest | ||
run: python -m pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_neuralmagic.py --ignore=tests/models/test_openvino.py | ||
- name: Archive artifacts | ||
|
@@ -65,29 +68,23 @@ jobs: | |
name: output_testcpu${{ matrix.python-version }} | ||
path: | | ||
test_logs/* | ||
testmodels: | ||
name: External LM Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
env: | ||
UV_SYSTEM_PYTHON: 1 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
enable-cache: true | ||
cache-dependency-glob: "**/pyproject.toml" | ||
python-version: 3.9 | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
- name: Install dependencies | ||
run: | | ||
uv pip install -e '.[dev,optimum,deepsparse,sparseml,api]' --extra-index-url https://download.pytorch.org/whl/cpu --system | ||
uv pip install -U transformers peft --system | ||
python -m pip install --upgrade pip | ||
pip install -e '.[dev,optimum,deepsparse,sparseml,api]' --extra-index-url https://download.pytorch.org/whl/cpu | ||
pip install -U transformers peft | ||
- name: Test with pytest | ||
run: python -m pytest tests/models --showlocals -s -vv |