Merge pull request 'Add homelab Gitea Actions CI (generic)' (#5) from ci/bootstrap-gitea-actions-baseline into feature/cleanup-providers-llama-only
This commit is contained in:
commit
3942d979e7
@ -1,102 +1,42 @@
|
|||||||
|
---
|
||||||
|
# ci-sync: 2026-05-30T01:30:53Z
|
||||||
|
# Homelab CI — baseline secret scan (git-ci-02)
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, master, develop, feature/** ]
|
branches: [master, main]
|
||||||
pull_request:
|
pull_request:
|
||||||
# Trigger on all pull requests regardless of target branch
|
types: [opened, synchronize, reopened]
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
skip-ci-check:
|
||||||
name: Lint with ruff
|
runs-on: [homelab, self-hosted, linux]
|
||||||
runs-on: ubuntu-latest
|
container:
|
||||||
|
image: node:20-bookworm
|
||||||
|
outputs:
|
||||||
|
should-skip: ${{ steps.check.outputs.skip }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
fetch-depth: 1
|
||||||
|
- id: check
|
||||||
- name: Install ruff
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
SKIP=0
|
||||||
pip install ruff>=0.1.0
|
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
||||||
|
MSG="${GITHUB_EVENT_HEAD_COMMIT_MESSAGE:-$(git log -1 --pretty=%B 2>/dev/null || true)}"
|
||||||
- name: Run ruff check
|
echo "$BRANCH" "$MSG" | grep -qi '@skipci' && SKIP=1
|
||||||
run: |
|
echo "skip=$SKIP" >> $GITHUB_OUTPUT
|
||||||
ruff check nanobot/
|
|
||||||
|
|
||||||
- name: Run ruff format check
|
|
||||||
run: |
|
|
||||||
ruff format --check nanobot/
|
|
||||||
|
|
||||||
test:
|
|
||||||
name: Test Python ${{ matrix.python-version }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version: ['3.11', '3.12']
|
|
||||||
|
|
||||||
|
secret-scan:
|
||||||
|
needs: skip-ci-check
|
||||||
|
if: needs.skip-ci-check.outputs.should-skip != '1'
|
||||||
|
runs-on: [homelab, self-hosted, linux, heavy]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
fetch-depth: 0
|
||||||
|
- name: Gitleaks
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
docker run --rm -v "$PWD:/repo" ghcr.io/gitleaks/gitleaks:latest \
|
||||||
# Install nanobot with all dependencies and dev dependencies
|
detect --source /repo --no-banner --redact
|
||||||
pip install -e ".[dev]"
|
|
||||||
# Verify key dependencies are installed
|
|
||||||
pip list | grep -E "(pytest|ruff|pydantic|typer|litellm)"
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
pytest tests/ -v --tb=short
|
|
||||||
|
|
||||||
- name: Check package can be imported
|
|
||||||
run: |
|
|
||||||
python -c "import nanobot; print(f'nanobot version check passed')"
|
|
||||||
|
|
||||||
build:
|
|
||||||
name: Build package
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [lint, test]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
|
|
||||||
- name: Install build dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install build hatchling
|
|
||||||
|
|
||||||
- name: Build package
|
|
||||||
run: |
|
|
||||||
python -m build
|
|
||||||
|
|
||||||
- name: Check build artifacts
|
|
||||||
run: |
|
|
||||||
ls -lh dist/
|
|
||||||
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: dist-packages
|
|
||||||
path: dist/
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user