Skip to content

Migrate to uv

Migrate to uv #1727

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PIPELINE_FAMILY: "general"
jobs:
lint:
runs-on: opensource-linux-8core
steps:
- uses: actions/checkout@v5
- name: Read Python version from .python-version
run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ env.PYTHON_VERSION }}
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --extra test --frozen
- name: Lint
run: make check
shellcheck:
runs-on: opensource-linux-8core
steps:
- uses: actions/checkout@v5
- name: ShellCheck
uses: ludeeus/action-shellcheck@master
test:
runs-on: opensource-linux-8core
needs: lint
steps:
- uses: actions/checkout@v5
- name: Read Python version from .python-version
run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ env.PYTHON_VERSION }}
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies and run core tests
run: |
sudo apt-get update && sudo apt-get install --yes poppler-utils libreoffice
uv sync --extra test --frozen
make install-pandoc
make install-nltk-models
sudo add-apt-repository -y ppa:alex-p/tesseract-ocr5
sudo apt-get install -y tesseract-ocr tesseract-ocr-kor
tesseract --version
make test
make check-coverage
changelog:
runs-on: opensource-linux-8core
steps:
- uses: actions/checkout@v5
- if: github.ref != 'refs/heads/main'
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'doc_recipe/**'
- 'recipe-notebooks/**'
- if: steps.changes.outputs.src == 'true' && github.ref != 'refs/heads/main'
uses: dangoslen/changelog-enforcer@v3
# TODO - figure out best practice for caching docker images
test_dockerfile:
runs-on: opensource-linux-8core
needs: lint
steps:
- uses: actions/checkout@v5
- name: Read Python version from .python-version
run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ env.PYTHON_VERSION }}
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Free up disk space
run: |
# Clear some space (https://github.com/actions/runner-images/issues/2840)
echo "Disk usage before cleanup:"
df -h
# Remove unnecessary pre-installed software
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/swift
# Clean up docker to ensure we start fresh
docker system prune -af --volumes
echo "Disk usage after cleanup:"
df -h
- name: Test Dockerfile
run: |
uv sync --extra test --frozen
make docker-build
make docker-test