ci(actions): add Gitea Actions ci+release workflows + fix ruff findings
- .gitea/workflows/ci.yml: ruff + matrix pytest on 3.10/3.11/3.12 on push and PR to main; concurrency cancels superseded runs - .gitea/workflows/release.yml: gate (ruff + pytest) + build sdist/wheel on tag 'v*', uploads via actions/upload-artifact@v4 - README.md: add ci and version badges right under H1 - src/viandante/cli.py: drop unused prompt_toolkit.patch_stdout import - tests/test_deadsouls.py: add missing RoomBlock import (F821) - tests/test_logger.py: drop unused local 'raw' in unicode test - tests/test_mapper.py: rename unused locals to _a/_b/_c (F841) to preserve intent (B has 's' back-edge; C is orphan)
This commit is contained in:
1 parent
2a8b472d4c
commit
b20f3c0f31
7 files changed
+136
-5
No files matched your search
@@ -0,0 +1,58 @@
|
||||
name: ci
|
||||
|
||||
"on":
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
ruff:
|
||||
name: lint (ruff)
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python 3.12 (for ruff)
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install dev extras (pulls ruff from pyproject)
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Run ruff
|
||||
run: python -m ruff check src tests
|
||||
|
||||
pytest:
|
||||
name: pytest (py${{ matrix.python-version }})
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: pip
|
||||
cache-dependency-path: pyproject.toml
|
||||
|
||||
- name: Install dev extras
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Run pytest
|
||||
run: python -m pytest -q
|
||||
@@ -0,0 +1,71 @@
|
||||
name: release
|
||||
|
||||
"on":
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
concurrency:
|
||||
group: release-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
gate:
|
||||
name: gate (ruff + pytest)
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
cache-dependency-path: pyproject.toml
|
||||
|
||||
- name: Install dev extras
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Ruff
|
||||
run: python -m ruff check src tests
|
||||
|
||||
- name: Pytest
|
||||
run: python -m pytest -q
|
||||
|
||||
build:
|
||||
name: build (sdist + wheel)
|
||||
needs: gate
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
cache-dependency-path: pyproject.toml
|
||||
|
||||
- name: Install build + dev extras
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
python -m pip install build
|
||||
python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Build sdist and wheel
|
||||
run: python -m build
|
||||
|
||||
- name: Inspect artifacts
|
||||
run: ls -la dist/
|
||||
|
||||
- name: Upload distributions as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: viandante-dist
|
||||
path: dist/*
|
||||
if-no-files-found: error
|
||||
retention-days: 90
|
||||
Reference in new issue
Block a user