Skip to content

Commit f9219d2

Browse files
committed
updating gh actions for uv build
1 parent b142e69 commit f9219d2

File tree

2 files changed

+37
-16
lines changed

2 files changed

+37
-16
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- '**/_version.py'
88
push:
99
branches: [ main ]
10+
tags-ignore:
11+
- 'v*'
1012
paths-ignore:
1113
- '**/_version.py'
1214
workflow_dispatch:
@@ -20,22 +22,42 @@ jobs:
2022
strategy:
2123
fail-fast: false
2224
matrix:
23-
python-version: ["3.9", "3.10", "3.11", "3.12"]
25+
python-version: ["3.10", "3.11", "3.12", "3.13"]
26+
uv-resolution: ["highest", "lowest"]
27+
exclude:
28+
- python-version: "3.11"
29+
uv-resolution: "lowest"
30+
- python-version: "3.12"
31+
uv-resolution: "lowest"
32+
env:
33+
PYTHON_VERSION: ${{ matrix.python-version }}
2434
steps:
2535
- uses: actions/checkout@v4
26-
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v4
36+
- name: Install uv
37+
id: setup-uv
38+
uses: astral-sh/setup-uv@v7
2839
with:
29-
python-version: ${{ matrix.python-version }}
30-
cache: 'pip'
40+
python-version: ${{ github.event.inputs.python-version }}
3141
- name: Set up AllenInstitute Repo Authorization
3242
uses: ./.github/actions/configure-org-repo-authorization
3343
with:
3444
token: ${{ secrets.AI_PACKAGES_TOKEN }}
3545
ssh_private_key: ${{ secrets.AIBSGITHUB_PRIVATE_KEY }}
3646
- name: Run Release
3747
run: |
38-
make release
48+
if [ ${{ matrix.uv-resolution }} == "highest" ]; then
49+
make release
50+
else
51+
# Install dependencies
52+
uv sync --frozen --group dev --resolution ${{ matrix.uv-resolution }}
53+
54+
# Linting
55+
uv run ruff check
56+
uv run mypy ./
57+
58+
# Testing
59+
uv run pytest -vv --durations=10
60+
fi
3961
shell: bash
4062
- name: Upload coverage reports
4163
if: |
@@ -46,11 +68,10 @@ jobs:
4668
|| (github.event_name == 'push' && github.ref_name == 'main')
4769
|| github.event_name == 'workflow_dispatch'
4870
)
49-
&& matrix.python-version == '3.11'
71+
&& matrix.python-version == '3.12'
5072
}}
5173
uses: codecov/codecov-action@v5
5274
with:
5375
# https://github.com/codecov/codecov-action#arguments
5476
token: ${{ secrets.CODECOV_TOKEN }}
5577
env_vars: PYTHON_VERSION
56-

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
type: choice
2020
required: true
2121
default: "3.11"
22-
options: ["3.9", "3.10", "3.11", "3.12"]
22+
options: ["3.10", "3.11", "3.12", "3.13"]
2323

2424
jobs:
2525
bump:
@@ -41,11 +41,11 @@ jobs:
4141
uses: actions/checkout@v4
4242
with:
4343
ssh-key: ${{ secrets.AIBSGITHUB_PRIVATE_KEY }}
44-
- name: Set up Python ${{ github.event.inputs.python-version }}
45-
uses: actions/setup-python@v4
44+
- name: Install uv
45+
id: setup-uv
46+
uses: astral-sh/setup-uv@v7
4647
with:
4748
python-version: ${{ github.event.inputs.python-version }}
48-
cache: 'pip'
4949
- name: Set up AllenInstitute Repo Authorization
5050
uses: ./.github/actions/configure-org-repo-authorization
5151
with:
@@ -63,7 +63,7 @@ jobs:
6363
- name: Bump version with bumpversion
6464
run: |
6565
source .venv/bin/activate
66-
bump-my-version bump ${{ github.event.inputs.part }}
66+
uvx --from bump-my-version bump-my-version bump ${{ github.event.inputs.part }}
6767
- name: Commit and push with tags
6868
if: ${{ github.event.inputs.dry-run == 'false' }}
6969
run: |
@@ -106,11 +106,11 @@ jobs:
106106
with:
107107
ref: ${{ needs.bump.outputs.VERSION_TAG }}
108108
ssh-key: ${{ secrets.AIBSGITHUB_PRIVATE_KEY }}
109-
- name: Set up Python ${{ github.event.inputs.python-version }}
110-
uses: actions/setup-python@v4
109+
- name: Install uv
110+
id: setup-uv
111+
uses: astral-sh/setup-uv@v7
111112
with:
112113
python-version: ${{ github.event.inputs.python-version }}
113-
cache: 'pip'
114114
- name: Set up AllenInstitute Repo Authorization
115115
uses: ./.github/actions/configure-org-repo-authorization
116116
with:

0 commit comments

Comments
 (0)