Skip to content

Commit c235782

Browse files
committed
Update workflows
Includes CI checks, and automated PyPi trusted publishing
1 parent bcdcd27 commit c235782

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Basic CI setup: Lint with ruff, run tests with pytest
2+
name: Test
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
# Do not lint for now, as the code is not yet compliant
12+
#lint:
13+
# name: Lint
14+
# runs-on: ubuntu-latest
15+
# steps:
16+
# - uses: actions/checkout@v4
17+
# - uses: astral-sh/setup-uv@v3
18+
# - name: Ruff lint
19+
# run: uv run ruff check .
20+
# - name: Ruff format
21+
# run: uv run ruff format --diff .
22+
# # This isn't a general Python lint, this style is just used in this repository
23+
# - name: Prettier format
24+
# run: npx prettier --prose-wrap always --check "**/*.md"
25+
26+
test:
27+
name: Run tests
28+
strategy:
29+
matrix:
30+
os: [ubuntu-latest, macos-latest, windows-latest]
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: astral-sh/setup-uv@v3
35+
- run: uv run pytest

.github/workflows/pypi.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
# Publish on any tag starting with a `v`, e.g. v1.2.3
7+
- '*'
8+
9+
jobs:
10+
pypi:
11+
name: Publish to PyPI
12+
runs-on: ubuntu-latest
13+
# Environment and permissions trusted publishing.
14+
environment:
15+
# Create this environment in the GitHub repository under Settings -> Environments
16+
name: release
17+
permissions:
18+
id-token: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: astral-sh/setup-uv@v3
22+
- run: uv build
23+
- run: uv publish --trusted-publishing always

.github/workflows/sphinx-documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
name: Sphinx documentation to GitHub pages
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Installing the library
16+
- name: Building HTML
17+
uses: astral-sh/setup-uvv5
1718
shell: bash -l {0}
1819
run: |
19-
curl -LsSf https://astral.sh/uv/install.sh | sh
2020
uv run sphinx-build -M html docs/source/ docs/build/
2121
- name: Deploy
2222
uses: peaceiris/actions-gh-pages@v4

0 commit comments

Comments
 (0)