Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Use uv in CI #1019

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
types:
- opened
- synchronize

env:
UV_SYSTEM_PYTHON: 1

jobs:
changes:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,17 +56,19 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-insiders.txt') }}-v02
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs.txt
run: uv pip install -r requirements-docs.txt
- name: Install Material for MkDocs Insiders
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs-insiders.txt
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
run: uv pip install -r requirements-docs-insiders.txt
env:
TOKEN: ${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }}
- uses: actions/cache@v4
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Install GitHub Actions dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-github-actions.txt
run: uv pip install -r requirements-github-actions.txt
- name: Deploy Docs Status Pending
run: python ./scripts/deploy_docs_status.py
env:
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/smokeshow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Smokeshow

on:
workflow_run:
workflows: [Test]
types: [completed]
workflows:
- Test
types:
- completed

permissions:
statuses: write

env:
UV_SYSTEM_PYTHON: 1

jobs:
smokeshow:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
Expand All @@ -21,16 +26,21 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.9'

- run: pip install smokeshow

- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- run: uv pip install -r requirements-github-actions.txt
- uses: actions/download-artifact@v4
with:
name: coverage-html
path: htmlcov
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- run: smokeshow upload htmlcov
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
Expand Down
35 changes: 21 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
# cron every week on monday
- cron: "0 0 * * 1"

env:
UV_SYSTEM_PYTHON: 1

jobs:
test:
strategy:
Expand Down Expand Up @@ -41,18 +44,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- uses: actions/cache@v4
if: ${{ runner.os != 'macOS' }}
id: cache
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
run: uv pip install -r requirements-tests.txt
- name: Lint
run: bash scripts/lint.sh
- run: mkdir coverage
Expand Down Expand Up @@ -81,16 +82,22 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.8'
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- name: Get coverage files
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: coverage
merge-multiple: true
- run: pip install coverage[toml]
- name: Install Dependencies
run: uv pip install -r requirements-tests.txt
- run: ls -la coverage
- run: coverage combine coverage
- run: coverage report
Expand Down
1 change: 1 addition & 0 deletions requirements-github-actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ PyGithub>=2.3.0,<3.0.0
pydantic>=2.5.3,<3.0.0
pydantic-settings>=2.1.0,<3.0.0
httpx>=0.27.0,<0.28.0
smokeshow
Loading