Skip to content

chore(deps): update dependency uv to v0.9.10 (#316) #634

chore(deps): update dependency uv to v0.9.10 (#316)

chore(deps): update dependency uv to v0.9.10 (#316) #634

Workflow file for this run

---
name: Code checks
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
inputs:
force_release:
description: Force release
required: false
type: boolean
default: false
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-checks
cancel-in-progress: true
env:
UV_LINK_MODE: copy
UV_PYTHON_PREFERENCE: only-managed
UV_CACHE_DIR: /tmp/.uv-cache
MISE_INSTALL_FROM_GITHUB: 1
# The following repository variables control mise-action caching across jobs:
# - MISE_CACHE_ENABLED: set to 'false' to disable mise action caching; defaults to 'true' when unset
# - MISE_CACHE_KEY_PREFIX: prefix used for cache keys so different workflows can share/segregate caches
jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout current branch
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: jdx/mise-action@v3
with:
install: true
cache: ${{ vars.MISE_CACHE_ENABLED || 'true'}}
cache_key_prefix: ${{ vars.MISE_CACHE_KEY_PREFIX || 'mise-v0'}}
version: ${{ vars.MISE_VERSION }}
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Setup venv
run: |
uv python install
uv sync --no-group docs
- name: Check if uv lock file is up to date
env:
UV_KEYRING_PROVIDER: subprocess
run: |
echo "::group::Check if uv lock file is up to date"
echo "Detect files that could affect the dynamic versioning if any (git dirty state)"
git status --porcelain --untracked-files
echo "Performing 'uv lock' in dry-run mode"
uv lock --dry-run
echo "Performing 'uv lock'"
if ! uv lock --locked ; then
echo "::error title=uv lock file::The lockfile at 'uv.lock' needs to be updated. To update the lockfile, run 'uv lock'"
exit 1
fi
echo "::endgroup::"
- name: Minimize uv cache
run: uv cache prune --ci
- name: Detect Python version
id: detect-python-version
run: |
echo "python_version=$(python --version | cut -d " " -f2 | cut -d . -f1-2)" >> "${GITHUB_OUTPUT}"
- name: Restore pre-commit cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ steps.detect-python-version.outputs.python_version }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit checks
run: |
echo "::group::Run pre-commit checks"
pre-commit run --all-files --show-diff-on-failure
echo "::endgroup::"
python-checks:
name: Python checks
runs-on: ubuntu-latest
outputs:
deploy_env: ${{ steps.detect-deploy-env.outputs.deploy_env }}
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: jdx/mise-action@v3
with:
install: true
cache: ${{ vars.MISE_CACHE_ENABLED || 'true'}}
cache_key_prefix: ${{ vars.MISE_CACHE_KEY_PREFIX || 'mise-v0'}}
version: ${{ vars.MISE_VERSION }}
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Setup venv
run: |
uv python install
make setup-venv
- name: Python checks
run: |
echo "::group::make lint"
make lint
echo "::endgroup::"
echo "::group::make test"
make test
echo "::endgroup::"
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: generated/junit.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Minimize uv cache
run: uv cache prune --ci
- name: Check we can build the distribution
run: |
echo "::group::make dist"
make dist
echo "::endgroup::"
- name: Store the distribution packages
uses: actions/upload-artifact@v5
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'pull_request' && github.head_ref == 'release-please--branches--main') || inputs.force_release
with:
name: python-package-distributions
path: dist/
- name: Detect environment
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'pull_request' && github.head_ref == 'release-please--branches--main') || inputs.force_release
id: detect-deploy-env
run: |
echo "deploy_env=${{ startsWith(github.ref, 'refs/tags') && 'pypi' || 'testpypi' }}" >> "${GITHUB_OUTPUT}"
deploy-release:
name: Deploy Release
runs-on: ubuntu-latest
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'pull_request' && github.head_ref == 'release-please--branches--main') || inputs.force_release
environment:
name: ${{ needs.python-checks.outputs.deploy_env }}
url: ${{ needs.python-checks.outputs.deploy_env == 'pypi' && 'https://pypi.org/project/yamkix/' || 'https://test.pypi.org/project/yamkix/' }}
permissions:
id-token: write
needs:
- python-checks
steps:
- name: Download the distribution packages
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ needs.python-checks.outputs.deploy_env == 'pypi' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
mkdocs:
name: Build doc
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: jdx/mise-action@v3
with:
install: true
cache: ${{ vars.MISE_CACHE_ENABLED || 'true'}}
cache_key_prefix: ${{ vars.MISE_CACHE_KEY_PREFIX || 'mise-v0'}}
version: ${{ vars.MISE_VERSION }}
mise_toml: |
[tools]
uv = "latest"
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Setup venv
run: |
uv python install
uv sync --group docs
- name: Check we can build the docs
run: |
echo "::group::build docs with mkdocs"
make build-docs
echo "::endgroup::"
integration-tests:
name: Run Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
- uses: jdx/mise-action@v3
with:
install: true
cache: ${{ vars.MISE_CACHE_ENABLED || 'true'}}
cache_key_prefix: ${{ vars.MISE_CACHE_KEY_PREFIX || 'mise-v0'}}
version: ${{ vars.MISE_VERSION }}
mise_toml: |
[tools]
uv = "latest"
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Setup venv
run: |
uv python install
uv sync --no-dev
- name: Run integration tests
run: |
echo "::group::run integration tests"
make integration-tests poe-integration-tests
echo "::endgroup::"
python-versions:
name: Run tests with various python versions
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: jdx/mise-action@v3
with:
install: true
cache: ${{ vars.MISE_CACHE_ENABLED || 'true'}}
cache_key_prefix: ${{ vars.MISE_CACHE_KEY_PREFIX || 'mise-v0'}}
version: ${{ vars.MISE_VERSION }}
mise_toml: |
[tools]
uv = "latest"
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Setup venv
run: |
uv python install
make setup-venv
- name: Run 'test-python-versions' task
run: |
echo "::group::make test-python-versions"
make test-python-versions
echo "::endgroup::"
finalizer:
if: always()
runs-on: Ubuntu-latest
needs:
- pre-commit
- python-checks
- mkdocs
- integration-tests
- python-versions
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}