Skip to content

Commit

Permalink
ci: use uv's official action, and uv build command
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Sep 6, 2024
1 parent 436a2ac commit 50c5cf0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ jobs:
with:
python-version: "3.12"

- uses: hynek/setup-cached-uv@v2
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: pyproject.toml

- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ jobs:
with:
python-version: 3.12

- uses: hynek/setup-cached-uv@v2
- run: uv pip install --upgrade setuptools_scm build twine --system
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true

- run: uv pip install --upgrade setuptools_scm 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 --installer=uv
- run: uv build
env:
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DVC: ${{ env.version }}
- run: twine check --strict dist/*
Expand Down Expand Up @@ -67,6 +70,7 @@ jobs:
- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
repository-url: https://test.pypi.org/legacy/
skip-existing: true

Expand All @@ -91,3 +95,5 @@ jobs:

- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
8 changes: 4 additions & 4 deletions .github/workflows/plugin_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:
with:
python-version: ${{ matrix.pyv }}

- uses: hynek/setup-cached-uv@v2
- uses: astral-sh/setup-uv@v2
with:
cache-dependency-path: |
dvc/pyproject.toml
${{ matrix.plugin }}/pyproject.toml
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
cache-suffix: ${{ matrix.pyv }}

- name: Install plugin + DVC@PR
run: |
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: hynek/setup-cached-uv@v2
- uses: astral-sh/setup-uv@v2
with:
cache-dependency-path: pyproject.toml
enable-cache: true
cache-dependency-glob: pyproject.toml
- run: uv pip install -e ".[dev]" --system
env:
UV_LINK_MODE: ${{ runner.os == 'Windows' && 'symlink' || 'hardlink' }}
Expand Down Expand Up @@ -86,10 +87,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}
- uses: hynek/setup-cached-uv@v2
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: ${{ matrix.pyv }}
cache-dependency-path: pyproject.toml
- run: uv pip install -e ".[dev]" pytest-split --system
env:
UV_LINK_MODE: ${{ runner.os == 'Windows' && 'symlink' || 'hardlink' }}
Expand Down

0 comments on commit 50c5cf0

Please sign in to comment.