Add Gitea Actions workflow: ci.yml
Some checks failed
CI / lint (push) Has been cancelled
CI / lint-markdown (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
2026-01-30 11:56:31 +00:00
parent a799a9f62e
commit 606d798905

83
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,83 @@
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e ".[dev]"
- name: Run tests
run: pytest tests/ -v --tb=short
- name: Run with coverage
run: pytest tests/ --cov=shell_memory --cov-report=term-missing
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install flake8
run: pip install flake8
- name: Run linter
run: flake8 shell_memory/ tests/ --max-line-length=100 --exclude=__pycache__
lint-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Markdown files
run: |
if command -v markdownlint &> /dev/null; then
markdownlint "**/*.md" --ignore=node_modules
else
echo "markdownlint not installed, skipping"
fi
build:
runs-on: ubuntu-latest
needs: [test, lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build dependencies
run: pip install build
- name: Build package
run: python -m build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/