Skip to content

Update astral-sh/setup-uv action to v6.3.1 #1401

Update astral-sh/setup-uv action to v6.3.1

Update astral-sh/setup-uv action to v6.3.1 #1401

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
paths-ignore:
- README.md
- CHANGELOG.md
workflow_dispatch:
jobs:
unit-tests:
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- '3.11'
- '3.12'
- '3.13'
include:
- os: ubuntu-22.04
python-version: 3.10.0
label: oldestdeps
- os: macos-latest
python-version: 3.10.0
- os: macos-latest
python-version: '3.13'
- os: windows-latest
python-version: 3.10.0
- os: windows-latest
python-version: '3.13'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: false
cache-suffix: covcheck
- if: ${{ matrix.label == 'oldestdeps' }}
run: echo "UV_RESOLUTION=lowest-direct" >> $GITHUB_ENV
- name: Run tests (without coverage)
if: ${{ ! startswith( matrix.os, 'ubuntu' ) }}
shell: bash # for windows portability
run: |
uv run --frozen --no-editable --group test \
pytest --color=yes
- name: Run tests (with coverage)
if: ${{ startswith( matrix.os, 'ubuntu' ) }}
run: |
uv run --group covcheck \
coverage run --parallel-mode -m pytest --color=yes
- name: Upload coverage data
# only using reports from ubuntu because
# combining reports from multiple platforms is tricky (or impossible ?)
if: ${{ startswith( matrix.os, 'ubuntu' ) }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: inifix_coverage_data-${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage.*
if-no-files-found: ignore
include-hidden-files: true
concurrency-tests:
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- 3.10.0
- '3.13'
- 3.13t
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: false
cache-suffix: concurrency
- run: uv sync --frozen --no-editable --group concurrency
- run: |
uv run --no-sync \
pytest --color=yes --count 100 -k concurrency
coverage:
name: Combine & check coverage
runs-on: ubuntu-latest
needs: unit-tests
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
with:
python-version: '3.13'
activate-environment: true
enable-cache: true
prune-cache: false
cache-suffix: covcheck
- run: uv sync --group covcheck
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: inifix_coverage_data-*
merge-multiple: true
- name: Check coverage
run: |
coverage combine
coverage html --skip-covered --skip-empty
coverage report --fail-under=100
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: inifix_coverage_report
path: htmlcov
if: ${{ failure() }}
type-check:
strategy:
matrix:
python-version:
- '3.10'
- '3.13'
typechecker:
- mypy
- pyright
- basedpyright
runs-on: ubuntu-latest
name: type check
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: true
prune-cache: false
cache-suffix: typecheck
- run: uv sync --frozen --group typecheck
- name: Typecheck source code (inifix-cli)
run: ${{ matrix.typechecker }} src
- name: Typecheck source code (inifix)
run: ${{ matrix.typechecker }} lib/inifix/src typechecks
- name: Verify Types (pyright only)
if: ${{ startsWith( matrix.typechecker , 'pyright' ) }}
run: ${{ matrix.typechecker }} --verifytypes inifix
optimized_python:
runs-on: ubuntu-latest
name: optimized Python
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
with:
python-version: '3.13'
enable-cache: true
prune-cache: false
cache-suffix: test
- run: uv sync --frozen --no-editable --group test
- name: Run pytest with PYTHONOPTIMIZE=2
run: uv run --no-sync pytest --color=yes
env:
PYTHONOPTIMIZE: 2
pre-publish-checks:
runs-on: ubuntu-latest
name: pre-publication checks
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
with:
enable-cache: true
prune-cache: false
cache-suffix: pre-publish-checks
- run: uv run scripts/pre_publish_checks.py