Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 34 additions & 19 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,44 @@ concurrency:
env:
UV_VERSION: "0.9.4"

permissions: {}

jobs:
pre-commit:
prek:
runs-on: ubuntu-latest
name: Pre-commit hooks (lint/format/spell/type, all files)
name: Prek hooks (lint/format/spell/type, all files)
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@b75dde52aef63a238519e7aecbbe79a4a52e4315 # v7
with:
enable-cache: true
version: ${{ env.UV_VERSION }}

- name: Install dependencies
run: uv sync --all-groups

- name: Run pre-commit
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage push
- name: Run prek
run: uv run prek run --show-diff-on-failure --color=always --all-files --hook-stage pre-push


pytest:
name: Tests ${{ matrix.os }} / py${{ matrix.python }}
needs: pre-commit
needs: prek
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -50,10 +57,12 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@b75dde52aef63a238519e7aecbbe79a4a52e4315 # v7
with:
enable-cache: true
version: ${{ env.UV_VERSION }}
Expand All @@ -69,23 +78,25 @@ jobs:
uv run pytest --cov --cov-report=xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

benchmarks:
name: Benchmarks
needs: pre-commit
needs: prek
runs-on: ubuntu-latest
continue-on-error: true
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@b75dde52aef63a238519e7aecbbe79a4a52e4315 # v7
with:
enable-cache: true
version: ${{ env.UV_VERSION }}
Expand All @@ -100,7 +111,7 @@ jobs:
run: uv run pytest benchmarks/ -k "not xlarge_300k" --benchmark-only --benchmark-json=benchmark-results.json --no-cov

- name: Download previous benchmark data
uses: actions/cache@v5
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: ./cache
key: ${{ runner.os }}-benchmark-${{ github.head_ref || github.ref_name }}-${{ github.run_id }}
Expand All @@ -112,7 +123,7 @@ jobs:
run: mkdir -p cache && test -f cache/benchmark-data.json || echo '[]' > cache/benchmark-data.json

- name: Publish benchmark results
uses: benchmark-action/github-action-benchmark@v1
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1
with:
tool: pytest
output-file-path: benchmark-results.json
Expand All @@ -127,17 +138,21 @@ jobs:
name: Package smoke test
needs: pytest
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@b75dde52aef63a238519e7aecbbe79a4a52e4315 # v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ on:
pull_request:
types: [opened, reopened, synchronize]

permissions: {}

jobs:
lint-commit-messages:
name: lint commit message
runs-on: [ubuntu-latest]
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@b75dde52aef63a238519e7aecbbe79a4a52e4315 # v7
- name: Commitizen check
run: |
uvx --from commitizen cz check --rev-range HEAD^!
Expand All @@ -26,6 +31,6 @@ jobs:
permissions:
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@v6.1.1
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 8 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ on:

workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@b75dde52aef63a238519e7aecbbe79a4a52e4315 # v7
with:
version: "latest"

Expand All @@ -30,7 +35,7 @@ jobs:
run: uv run sphinx-build docs/source/ docs/_build/

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
uses: peaceiris/actions-gh-pages@e9c66a37f080288a11235e32cbe2dc5fb3a679cc # v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: labeler

on:
pull_request_target:
pull_request_target: # zizmor: ignore[dangerous-triggers]
types: [opened, reopened, synchronize]

jobs:
Expand All @@ -13,8 +13,10 @@ jobs:
issues: write
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/labeler@v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yaml
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/publish_pypi.yaml

This file was deleted.

41 changes: 20 additions & 21 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ concurrency:
group: release-please
cancel-in-progress: true

permissions:
contents: write
pull-requests: write
id-token: write
permissions: {}

env:
UV_VERSION: "0.9.4"

jobs:
release-please:
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag: ${{ steps.release.outputs.tag_name }}
runs-on: ubuntu-latest
steps:
- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
uses: googleapis/release-please-action@c3fc4de07084f75a2b61a5b933069bda6edf3d5c # v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: .release-please-config.json
Expand All @@ -34,26 +34,24 @@ jobs:

build:
name: Build
permissions:
contents: read
needs: release-please
if: needs.release-please.outputs.release_created
runs-on: ubuntu-latest
steps:
- name: Checkout release commit
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ needs.release-please.outputs.release_tag }}
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
uses: astral-sh/setup-uv@b75dde52aef63a238519e7aecbbe79a4a52e4315 # v7

- name: Install dependencies
run: uv sync --all-groups
Expand All @@ -62,30 +60,31 @@ jobs:
run: uv build

- name: Store the distribution packages
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
with:
name: python-package-distributions
path: dist/

publish-testpypi:
permissions:
id-token: write
runs-on: ubuntu-latest
needs: build
environment:
name: testpypi
url: https://test.pypi.org/p/plexosdb
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@106e0b0b7c337fa67ed433972f777c6357f78598 # v1.13.0
with:
repository-url: https://test.pypi.org/legacy/

publish-pypi:
permissions:
id-token: write
needs:
- build
- publish-testpypi
Expand All @@ -95,9 +94,9 @@ jobs:
url: https://pypi.org/p/plexosdb
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@106e0b0b7c337fa67ed433972f777c6357f78598 # v1.13.0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ instance/
# Sphinx documentation
docs/_build/

# Implementation plans (local only)
docs/plans/

# PyBuilder
.pybuilder/
target/
Expand Down
Loading
Loading