Skip to content

Commit 737e74e

Browse files
raman325claude
andcommitted
Use uv instead of pip in pytest workflow
- Replace pip with uv for faster, more reliable dependency installation - Use astral-sh/setup-uv action with caching enabled - Use uv python install for Python setup - Use uv pip install --system for dependencies - Use uv run for pytest execution Also add self-referencing workflow paths to triggers so that changes to workflow files trigger their respective CI runs: - pytest.yaml - vitest.yaml - yarn.yaml Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 03f763d commit 737e74e

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

.github/workflows/pytest.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
branches: [main]
88
paths:
99
- "**.py"
10+
- ".github/workflows/pytest.yaml"
1011
pull_request:
1112
branches: [main]
1213
paths:
1314
- "**.py"
1415
- "requirements*.txt"
1516
- "pyproject.toml"
17+
- ".github/workflows/pytest.yaml"
1618

1719
jobs:
1820
test:
@@ -24,20 +26,22 @@ jobs:
2426

2527
steps:
2628
- uses: actions/checkout@v6
27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v6
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
2931
with:
30-
python-version: ${{ matrix.python-version }}
31-
- name: Install dependencies
32+
enable-cache: true
33+
- name: Set up Python ${{ matrix.python-version }}
34+
run: uv python install ${{ matrix.python-version }}
35+
- name: Install system dependencies
3236
run: |
3337
sudo apt-get update
3438
sudo apt-get install libudev-dev
35-
python -m pip install --upgrade pip
36-
pip install -r requirements_dev.txt
39+
- name: Install dependencies
40+
run: uv pip install --system -r requirements_dev.txt
3741
- name: Run tests and generate coverage report
3842
run: |
39-
pip install pytest-cov pytest-github-actions-annotate-failures
40-
pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml
43+
uv pip install --system pytest-cov pytest-github-actions-annotate-failures
44+
uv run --no-project pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml
4145
- name: Upload coverage to Codecov
4246
uses: codecov/codecov-action@v5
4347
with:

.github/workflows/vitest.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ on:
1010
- "ts/**"
1111
- "package.json"
1212
- "vitest.config.ts"
13+
- ".github/workflows/vitest.yaml"
1314
pull_request:
1415
branches: [main]
1516
paths:
1617
- "**.ts"
1718
- "ts/**"
1819
- "package.json"
1920
- "vitest.config.ts"
21+
- ".github/workflows/vitest.yaml"
2022

2123
jobs:
2224
test:

.github/workflows/yarn.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- "package.json"
1313
- "rollup.config.js"
1414
- "tsconfig.json"
15+
- ".github/workflows/yarn.yaml"
1516
pull_request:
1617
branches: [main]
1718
paths:
@@ -22,6 +23,7 @@ on:
2223
- "package.json"
2324
- "rollup.config.js"
2425
- "tsconfig.json"
26+
- ".github/workflows/yarn.yaml"
2527

2628
jobs:
2729
yarn:

0 commit comments

Comments
 (0)