Skip to content

Commit

Permalink
github action adopt uv
Browse files Browse the repository at this point in the history
  • Loading branch information
darjeeling committed Nov 13, 2024
1 parent 32e9f23 commit bab9734
Show file tree
Hide file tree
Showing 3 changed files with 1,039 additions and 20 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: Deploy Sphinx documentation to Github pages
on:
push:
branches:
- main
- main

env:
UV_SYSTEM_PYTHON: 1
UV_PYTHON_PREFERENCE: system

jobs:
docs:
Expand All @@ -14,10 +18,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9

python-version: 3.13

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.1"

- name: Install dependencies
run: pip install -e '.[docs]'
run: uv pip install -e '.[docs]'

- name: Build docs
run: sphinx-build docs ./docs/_build/html/
Expand Down
46 changes: 30 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@ name: Testing Central Dogma Python
on:
push:
branches:
- main
- main
pull_request:

env:
UV_SYSTEM_PYTHON: 1
UV_PYTHON_PREFERENCE: system

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.13
- name: Install dependencies
run: pip install -e '.[docs]'
- name : Build docs
run: uv pip install -e '.[docs]'
- name: Build docs
run: sphinx-build docs ./docs/_build/html/

linter:
Expand All @@ -35,7 +43,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
python-version:
["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@v4
Expand All @@ -46,14 +55,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.1"
enable-cache: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e '.[dev]'
uv pip install -r pyproject.toml --extra dev
- name: Test with pytest
run: |
Expand All @@ -71,22 +82,25 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11","3.12", "3.13", "pypy3.9", "pypy3.10"]
python-version:
["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.1"
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e '.[dev]'
uv pip install -r pyproject.toml --extra dev
- name: Test with pytest
run: |
Expand Down
Loading

0 comments on commit bab9734

Please sign in to comment.