Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit f3c3560

Browse files
committed
github workflows
1 parent 9ebaee5 commit f3c3560

File tree

4 files changed

+141
-0
lines changed

4 files changed

+141
-0
lines changed

Diff for: .github/workflows/main-checks.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Main branch checks
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
checks:
9+
uses: ./.github/workflows/shared.yml

Diff for: .github/workflows/publish-pypi.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publishing
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release-build:
9+
name: Build distribution
10+
runs-on: ubuntu-latest
11+
needs: [checks]
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
18+
- name: "Set up Python"
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version-file: ".python-version"
22+
23+
- name: Install the project
24+
run: uv sync --frozen --all-extras --dev
25+
26+
- name: Build
27+
run: uv build
28+
29+
- name: Upload artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: release-dists
33+
path: dist/
34+
35+
checks:
36+
uses: ./.github/workflows/shared.yml
37+
38+
pypi-publish:
39+
name: Upload release to PyPI
40+
runs-on: ubuntu-latest
41+
environment: release
42+
needs:
43+
- release-build
44+
permissions:
45+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
46+
47+
steps:
48+
- name: Retrieve release distributions
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: release-dists
52+
path: dist/
53+
54+
- name: Publish package distributions to PyPI
55+
uses: pypa/gh-action-pypi-publish@release/v1

Diff for: .github/workflows/pull-request-checks.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Pull request checks
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
checks:
8+
uses: ./.github/workflows/shared.yml

Diff for: .github/workflows/shared.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Shared Checks
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
format:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v3
14+
with:
15+
enable-cache: true
16+
17+
- name: "Set up Python"
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version-file: ".python-version"
21+
22+
- name: Install the project
23+
run: uv sync --frozen --all-extras --dev
24+
25+
- name: Run ruff format check
26+
run: uv run --frozen ruff check .
27+
28+
typecheck:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v3
35+
with:
36+
enable-cache: true
37+
38+
- name: "Set up Python"
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version-file: ".python-version"
42+
43+
- name: Install the project
44+
run: uv sync --frozen --all-extras --dev
45+
46+
- name: Run pyright
47+
run: uv run --frozen pyright
48+
49+
build:
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v3
57+
with:
58+
enable-cache: true
59+
60+
- name: "Set up Python"
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version-file: ".python-version"
64+
65+
- name: Install the project
66+
run: uv sync --frozen --all-extras --dev
67+
68+
- name: Run pytest
69+
run: uv run --frozen pytest

0 commit comments

Comments
 (0)