Skip to content

Migrate to uv clean #1238

Migrate to uv clean

Migrate to uv clean #1238

Workflow file for this run

# Built from:
# https://github.com/actions/checkout/
# https://github.com/actions/setup-python/
# https://github.com/codecov/codecov-action
name: Build and test linkml-runtime
env:
UV_VERSION: "0.7.13"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4.2.2
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- uses: actions/setup-python@v5.6.0
with:
python-version: 3.13
- name: Install tox
run: python -m pip install tox
- name: Run codespell
run: tox -e codespell
- name: Run code format checks
run: tox -e format_check
test:
needs:
- quality-checks
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
# Test on Windows with only the oldest and newest Python versions
exclude:
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.12"
# See https://github.com/snok/install-poetry#running-on-windows
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@4.2.2
with:
fetch-depth: 0
#----------------------------------------------
# install uv
#----------------------------------------------
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install dependencies
run: |
uv sync --group dev
- name: Verify uv.lock is up-to-date
run: uv lock --check
#----------------------------------------------
# coverage report
#----------------------------------------------
- name: Generate coverage results
# Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668
shell: bash
run: |
uv run coverage run -m pytest
uv run coverage xml
uv run coverage report -m
#----------------------------------------------
# upload coverage results
#----------------------------------------------
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
name: codecov-results-${{ matrix.os }}-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: false