feat: major heuristic structuring overhaul #159
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: Sync dependencies | |
| run: uv sync --extra dev | |
| - name: Lint | |
| run: | | |
| uv run ruff check mneme/ tests/ | |
| uv run black --check mneme/ tests/ | |
| - name: Type check | |
| run: uv run mypy mneme/ || true | |
| - name: Test | |
| run: uv run pytest tests/ -v | |
| publish: | |
| name: Publish to PyPI | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: '3.13' | |
| enable-cache: true | |
| - name: Sync version from git tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml | |
| sed -i "s/^__version__ = \".*\"/__version__ = \"${VERSION}\"/" mneme/__init__.py | |
| sed -i 's/"version": ".*"/"version": "'"${VERSION}"'"/' plugin/plugin.json | |
| sed -i 's/"version": ".*"/"version": "'"${VERSION}"'"/' docs/TOOLS.md | |
| sed -i "s/<!-- VERSION -->.*<!-- \/VERSION -->/<!-- VERSION -->${VERSION}<!-- \/VERSION -->/g" README.md | |
| sed -i "s/<!-- VERSION -->.*<!-- \/VERSION -->/<!-- VERSION -->${VERSION}<!-- \/VERSION -->/g" docs/index.html | |
| sed -i "s/<!-- VERSION -->.*<!-- \/VERSION -->/<!-- VERSION -->${VERSION}<!-- \/VERSION -->/g" docs/ARCHITECTURE.md | |
| sed -i "s/<!-- VERSION -->.*<!-- \/VERSION -->/<!-- VERSION -->${VERSION}<!-- \/VERSION -->/g" docs/WEB_UI.md | |
| - name: Build | |
| run: uv build | |
| - name: Publish | |
| run: uv publish --token ${{ secrets.PYPI }} |