Skip to content

Commit 42a6114

Browse files
HEROgoldCopilot
andauthored
Optimize workflows, utilizing caching and better workflows (#45)
* Optimize workflows, utilizing caching and better workflows * use uvx to auto-install ty for this workflow. * Fix workflow cache-hit condition referencing non-existent job outputs (#48) * Initial plan * Remove check-cache job and consolidate cache into test job Co-authored-by: HEROgold <21345384+HEROgold@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: HEROgold <21345384+HEROgold@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 35f8a95 commit 42a6114

File tree

4 files changed

+25
-43
lines changed

4 files changed

+25
-43
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
- uses: actions/checkout@v4
1919

2020
- name: Install uv
21-
uses: astral-sh/setup-uv@v4
21+
uses: astral-sh/setup-uv@v7
2222
with:
23-
version: "latest"
23+
enable-cache: true
2424

2525
- name: Set up Python 3.13
2626
run: uv python install 3.13

.github/workflows/docs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ jobs:
1818
with:
1919
python-version: '3.12'
2020

21-
- uses: astral-sh/setup-uv@v3
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
23+
with:
24+
enable-cache: true
2225

2326
- name: Generate docs (pdoc + mkdocs)
2427
run: |

.github/workflows/pypi.yml

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,32 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
build:
13-
name: Build distribution 📦
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
persist-credentials: false
20-
- name: Set up Python
21-
uses: actions/setup-python@v5
22-
with:
23-
python-version: "3.x"
24-
- name: Install pypa/build
25-
run: >-
26-
python3 -m
27-
pip install
28-
uv
29-
- name: Build a binary wheel and a source tarball
30-
run: uv build --sdist --wheel --out-dir dist
31-
- name: Store the distribution packages
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: python-package-distributions
35-
path: dist/
36-
3712
publish-to-pypi:
3813
name: Publish Python 🐍 distribution 📦 to PyPI
39-
needs:
40-
- build
4114
runs-on: ubuntu-latest
4215
environment:
4316
name: pypi
4417
url: https://pypi.org/p/confkit
4518
permissions:
4619
id-token: write # IMPORTANT: mandatory for trusted publishing
20+
contents: read
4721

4822
steps:
49-
- name: Download all the dists
50-
uses: actions/download-artifact@v4
23+
- name: Checkout
24+
uses: actions/checkout@v4
5125
with:
52-
name: python-package-distributions
53-
path: dist/
26+
persist-credentials: false
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v7
30+
with:
31+
enable-cache: true
32+
33+
- name: Set up Python
34+
run: uv python install 3.14
35+
36+
- name: Build distribution 📦
37+
run: uv build
38+
5439
- name: Publish distribution 📦 to PyPI
55-
uses: pypa/gh-action-pypi-publish@release/v1
40+
run: uv publish

.github/workflows/test.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,21 @@ jobs:
3434
${{ runner.os }}-pytest-${{ matrix.python-version }}-
3535
3636
- name: Install uv
37-
if: steps.cache-pytest.outputs.cache-hit != 'true'
38-
uses: astral-sh/setup-uv@v4
37+
uses: astral-sh/setup-uv@v7
3938
with:
40-
version: "latest"
39+
enable-cache: true
4140

4241
- name: Set up Python ${{ matrix.python-version }}
43-
if: steps.cache-pytest.outputs.cache-hit != 'true'
4442
run: uv python install ${{ matrix.python-version }}
4543

4644
- name: Install dependencies
47-
if: steps.cache-pytest.outputs.cache-hit != 'true'
4845
run: uv sync --group dev
4946

5047
- name: Run tests
51-
if: steps.cache-pytest.outputs.cache-hit != 'true'
5248
run: uv run pytest .
5349

5450
- name: Run ruff check
55-
if: steps.cache-pytest.outputs.cache-hit != 'true'
5651
run: uv run ruff check .
5752

5853
- name: Run type checking
59-
if: steps.cache-pytest.outputs.cache-hit != 'true'
6054
run: uvx ty check . --ignore no-matching-overload

0 commit comments

Comments
 (0)