Skip to content

Commit 19ca877

Browse files
committed
Switched to UV, updated workflows
1 parent 4d03f59 commit 19ca877

File tree

5 files changed

+62
-46
lines changed

5 files changed

+62
-46
lines changed

.github/workflows/build-docs.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/code-quality.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ jobs:
4646
ref: ${{ github.head_ref }}
4747
token: ${{ secrets.WORKFLOW_COMMIT }}
4848

49+
- name: 🔭 Install UV
50+
uses: astral-sh/setup-uv@v5
51+
with:
52+
enable-cache: true
53+
cache-dependency-glob: "**/pyproject.toml"
54+
4955
- name: 🐍 Setup Python
5056
uses: actions/setup-python@v5
5157
with:
5258
python-version: "3.13"
53-
cache: "pip"
5459

5560
- name: 📦 Install Hatch
5661
uses: pypa/hatch@install

.github/workflows/deploy-docs.yml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Deploy Documentation
22

33
on:
4+
pull_request:
5+
branches: [ "main" ]
46
push:
57
branches: [ "main" ]
68
workflow_dispatch:
@@ -16,20 +18,53 @@ concurrency:
1618

1719
jobs:
1820

19-
build:
20-
name: Build
21-
uses: ./.github/workflows/build-docs.yml
21+
build-docs:
22+
name: Build Documentation
23+
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: 🛎 Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
ref: ${{ github.head_ref }}
31+
32+
- name: 🔭 Install UV
33+
uses: astral-sh/setup-uv@v5
34+
with:
35+
enable-cache: true
36+
cache-dependency-glob: "**/pyproject.toml"
37+
38+
- name: 🐍 Setup Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.13"
42+
43+
- name: 📦 Install Hatch
44+
uses: pypa/hatch@install
45+
46+
- name: 🔨 Build Documentation
47+
run: hatch -e docs run build
48+
49+
# Upload artifact on main.
50+
- name: ⬆️ Upload Artifacts
51+
if: github.ref == 'refs/heads/main'
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: "site"
2255

2356
deploy:
2457
name: Deploy Documentation
25-
26-
needs: build
58+
59+
runs-on: ubuntu-latest
60+
61+
if: github.ref == 'refs/heads/main'
2762

2863
environment:
2964
name: github-pages
3065
url: ${{ steps.deployment.outputs.page_url }}
31-
32-
runs-on: ubuntu-latest
66+
67+
needs: build-docs
3368

3469
steps:
3570

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ jobs:
2525
with:
2626
ref: ${{ github.head_ref }}
2727

28+
- name: 🔭 Install UV
29+
uses: astral-sh/setup-uv@v5
30+
with:
31+
enable-cache: true
32+
cache-dependency-glob: "**/pyproject.toml"
33+
2834
- name: 🐍 Setup Python
2935
uses: actions/setup-python@v5
3036
with:
3137
python-version: "3.13"
32-
cache: "pip"
3338

3439
- name: 📦 Install Hatch
3540
uses: pypa/hatch@install
@@ -52,11 +57,16 @@ jobs:
5257
with:
5358
ref: ${{ github.head_ref }}
5459

60+
- name: 🔭 Install UV
61+
uses: astral-sh/setup-uv@v5
62+
with:
63+
enable-cache: true
64+
cache-dependency-glob: "**/pyproject.toml"
65+
5566
- name: 🐍 Setup Python
5667
uses: actions/setup-python@v5
5768
with:
5869
python-version: "3.13"
59-
cache: "pip"
6070

6171
- name: 📦 Install Hatch
6272
uses: pypa/hatch@install

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ path = "src/ephys_link/__about__.py"
5959
exclude = ["/.github", "/.idea", "/docs"]
6060

6161
[tool.hatch.envs.default]
62+
installer = "uv"
6263
python = "3.13.1"
6364
dependencies = [
6465
"pyinstaller==6.11.1",
@@ -71,6 +72,7 @@ check = "basedpyright"
7172
check-watched = "basedpyright --watch"
7273

7374
[tool.hatch.envs.docs]
75+
installer = "uv"
7476
python = "3.13.1"
7577
skip-install = true
7678
dependencies = [

0 commit comments

Comments
 (0)