Skip to content

Commit 49c8a48

Browse files
committed
chore: add ci
1 parent 859514e commit 49c8a48

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
test:
10+
name: Test and lint
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.11", "3.12"]
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba
22+
with:
23+
# version: ${{ vars.UV_VERSION }}
24+
# python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
25+
version: 0.7.3
26+
python-version: 3.12
27+
28+
- name: Install dependencies
29+
run: uv sync --all-extras
30+
31+
- name: Run linting
32+
run: |
33+
uv run black --check src/
34+
uv run isort --check-only src/
35+
uv run mypy src/
36+
37+
- name: Run tests
38+
run: uv run pytest

.github/workflows/publish.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
publish:
10+
name: Build and publish to PyPI
11+
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
14+
15+
steps:
16+
- name: Checkout hive.py
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
18+
with:
19+
fetch-depth: 0 # Fetch all history for setuptools-scm
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba
23+
with:
24+
version: ${{ vars.UV_VERSION }}
25+
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
26+
27+
- name: Install dependencies
28+
run: uv sync --all-extras
29+
30+
- name: Run linting
31+
run: |
32+
uv run black --check src/
33+
uv run isort --check-only src/
34+
uv run mypy src/
35+
36+
- name: Run tests
37+
run: uv run pytest
38+
39+
- name: Build and publish to PyPI
40+
run: uv publish
41+
env:
42+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)