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
39 changes: 26 additions & 13 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ on:
branches:
- main
workflow_dispatch:


permissions:
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
docs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -16,18 +24,23 @@ jobs:
run: uv python install
- name: Install the project
run: |
uv sync --all-extras --dev
- name: Runs tests
run: |
uv run pytest ./tests
uv sync --extra docs
- name: Sphinx build
run: |
uv run sphinx-build -M html docs/source docs/build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
force_orphan: true
path: docs/build/html

deploy:
needs: build
if: github.event_name == 'push' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
58 changes: 44 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,49 @@ on:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install the project
run: uv sync --extra lint
- name: Ruff check
run: uv run ruff check ./idecomp
- name: Ruff format check
run: uv run ruff format --check ./idecomp

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install the project
run: uv sync --extra lint
- name: Static type check
run: uv run mypy ./idecomp

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: |
uv sync --all-extras --dev
- name: Runs tests
run: |
uv run pytest --cov-report=xml --cov=idecomp ./tests
run: uv sync --extra test
- name: Run tests
run: uv run pytest --cov-report=xml --cov=idecomp ./tests
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -35,12 +61,16 @@ jobs:
name: codecov-idecomp
fail_ci_if_error: true
verbose: true
- name: Static type check
run: |
uv run mypy ./idecomp
- name: Linter code check
run: |
uv run ruff check ./idecomp

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install the project
run: uv sync --extra docs
- name: Sphinx build
run: |
uv run sphinx-build -M html docs/source docs/build
run: uv run sphinx-build -b html -W --keep-going docs/source docs/build/html
40 changes: 0 additions & 40 deletions .github/workflows/publish.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: release

on:
push:
tags:
- "v*"

jobs:
build-and-publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/idecomp
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
run: uv python install 3.12
- name: Install the project
run: uv sync --extra test --extra lint
- name: Validate version
run: |
PKG_VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' idecomp/__init__.py)
TAG_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch: __init__.py=$PKG_VERSION tag=$TAG_VERSION"
exit 1
fi
- name: Run tests
run: uv run pytest ./tests
- name: Type check
run: uv run mypy ./idecomp
- name: Lint check
run: uv run ruff check ./idecomp
- name: Build package
run: uv build
- name: PyPI publish
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} --generate-notes || echo "Release already exists"
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,10 @@ teste.py
teste.txt

# UV
uv.lock
uv.lock

# Claude Code
.claude/

# Implementation plans
plans/
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: local
hooks:
- id: mypy
name: mypy
entry: uv run --no-sync mypy ./idecomp
language: system
types: [python]
pass_filenames: false
stages: [pre-commit]
Loading