ci: use uv to install dependencies (#10507)

* ci: use uv to install dependencies

* split Windows tests into four for each python versions

* split tests and check into two jobs

* increase timeout
This commit is contained in:
skshetry
2024-08-14 13:24:56 +05:45
committed by GitHub
parent c514b0ea31
commit 52405a0e10
6 changed files with 2889 additions and 28 deletions
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- uses: iterative/dvc-bench@main
with:
pytest_options: "-k 'test_init or test_help'"
+3 -2
View File
@@ -27,14 +27,15 @@ jobs:
with:
python-version: 3.12
- run: python -m pip install --upgrade pip setuptools_scm build twine
- uses: hynek/setup-cached-uv@v2
- run: uv pip install --upgrade setuptools_scm build twine --system
- name: Force version for Test PyPI upload
if: ${{ !startsWith(github.ref, 'refs/tags') }}
run: echo version=$(python -m setuptools_scm | awk -F+ '{print $1}' | tail -1) >> $GITHUB_ENV
- run: echo 'PKG = "pip"'>dvc/_build.py
- run: python -m build
- run: python -m build --installer=uv
env:
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DVC: ${{ env.version }}
- run: twine check --strict dist/*
+8 -7
View File
@@ -18,8 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
pyv: ["3.10"]
os: [ubuntu-latest]
pyv: ["3.12"]
plugin: ["dvc-s3"]
steps:
@@ -37,16 +37,17 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}
cache: pip
- uses: hynek/setup-cached-uv@v2
with:
cache-dependency-path: |
dvc/pyproject.toml
${{ matrix.plugin }}/setup.cfg
${{ matrix.plugin }}/pyproject.toml
- name: Install plugin + DVC@PR
run: |
pip install --upgrade pip wheel
pip install "./dvc[testing]"
pip install -e "./${{ matrix.plugin }}[tests]"
uv pip install "./dvc[testing]" --system
uv pip install -e "./${{ matrix.plugin }}[tests]" --system
- name: Run plugin tests
timeout-minutes: 15
+65 -12
View File
@@ -16,15 +16,68 @@ permissions:
contents: read
jobs:
tests:
timeout-minutes: 50
lint:
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
pyv: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: hynek/setup-cached-uv@v2
with:
cache-dependency-path: pyproject.toml
- run: uv pip install -e ".[dev]" --system
env:
UV_LINK_MODE: ${{ runner.os == 'Windows' && 'symlink' || 'hardlink' }}
- name: Cache mypy
uses: actions/cache@v4
with:
path: .mypy_cache
key: mypy-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- uses: pre-commit/[email protected]
tests:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
pyv: ["3.9", "3.10", "3.11", "3.12"]
include:
- os: windows-latest
pyv: "3.9"
pytestargs: "--splits 4 --group 1"
- os: windows-latest
pyv: "3.9"
pytestargs: "--splits 4 --group 2"
- os: windows-latest
pyv: "3.9"
pytestargs: "--splits 4 --group 3"
- os: windows-latest
pyv: "3.9"
pytestargs: "--splits 4 --group 4"
- os: windows-latest
pyv: "3.12"
pytestargs: "--splits 4 --group 1"
- os: windows-latest
pyv: "3.12"
pytestargs: "--splits 4 --group 2"
- os: windows-latest
pyv: "3.12"
pytestargs: "--splits 4 --group 3"
- os: windows-latest
pyv: "3.12"
pytestargs: "--splits 4 --group 4"
steps:
- uses: actions/checkout@v4
with:
@@ -33,20 +86,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}
cache: pip
- uses: hynek/setup-cached-uv@v2
with:
cache-dependency-path: pyproject.toml
- name: install
run: |
pip install --upgrade pip wheel
pip install -e ".[dev]"
- uses: pre-commit/[email protected]
- run: uv pip install -e ".[dev]" pytest-split --system
env:
UV_LINK_MODE: ${{ runner.os == 'Windows' && 'symlink' || 'hardlink' }}
- name: run tests
timeout-minutes: 40
env:
PYTHONUTF8: 1
run: >
pytest -n=logical --timeout=300 --durations=100
--cov --cov-report=xml --cov-report=term
pytest ${{ matrix.pytestargs }} -n=logical --timeout=300 --durations=0
--cov --cov-report=xml --cov-report=term --durations-path=./.github/.test_durations
- name: upload coverage report
uses: codecov/codecov-action@v3
with: