Skip to content

Added minimum nodeenv package version #64

Added minimum nodeenv package version

Added minimum nodeenv package version #64

Workflow file for this run

name: Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Tests compatibility across Ubuntu/Windows and Python/package version extremes
os: [ubuntu-latest, windows-latest]
dependencies: [locked, oldest]
steps:
- uses: actions/checkout@v6
# When searching for a system Python version, uv will use the first compatible version - not the newest version.
# Therefore, make sure the newest version is available on the runner.
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: 3.x
# At the time of writing there is no way to force uv select the lowest version of Python.
# Therefore, extract this from pyproject.toml
# More info: https://github.com/astral-sh/uv/issues/16333
- name: Extract minimum Python version from pyproject.toml
if: matrix.dependencies == 'oldest'
id: python-version
shell: bash
run: |
MIN_PY=$(grep 'requires-python' pyproject.toml | sed -E 's/[^0-9.]//g')
echo "min=$MIN_PY" >> $GITHUB_OUTPUT
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
- name: Install locked dependencies
if: matrix.dependencies == 'locked'
run: uv sync --locked
- name: Install oldest dependencies
if: matrix.dependencies == 'oldest'
run: uv sync --resolution lowest --python ${{ steps.python-version.outputs.min }}
- name: Run pre-commit hooks
if: matrix.dependencies == 'locked'
run: uv run pre-commit run --all-files
- name: Run pytest
run: uv run pytest
- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.dependencies == 'locked'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}