Files
browser-use/.github/workflows/lint.yml
Magnus Müller 7b0b92991c Optimize lint workflow by skipping redundant uv sync checks
Add --no-sync flag to uv run commands that come after uv sync.

Before:
- uv sync (50s)
- uv run pre-commit (50s sync check + 8s run = 58s)
- Total: 108s

After:
- uv sync (50s)
- uv run --no-sync pre-commit (8s run)
- Total: 58s

Saves 50 seconds per lint job (46% faster)
2025-10-24 01:23:46 -07:00

51 lines
1.3 KiB
YAML

name: lint
# Cancel in-progress runs when a new commit is pushed to the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
- stable
- 'releases/**'
tags:
- '*'
pull_request:
workflow_dispatch:
jobs:
lint-syntax:
name: syntax-errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv run ruff check --no-fix --select PLE
lint-style:
name: code-style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync --dev --all-extras # install extras for examples to avoid pyright missing imports errors
- run: uv run --no-sync pre-commit run --all-files --show-diff-on-failure
lint-typecheck:
name: type-checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- run: uv sync --dev --all-extras # install extras for examples to avoid pyright missing imports errors-
- run: uv run --no-sync pyright