opencode-config/.github/workflows/ci.yml
Sergey 7249f1fcb5
fix(memory): keyword search out-of-box + doctor gaps + tests (#124)
* fix(docker): add system ripgrep via apt for keyword search fallback

* fix(ci): install ripgrep and npm deps for keyword search in CI

* fix(memory-search): warn when ripgrep not resolvable instead of silent skip

* fix(memory-doctor): check rg status, arch mismatch, and require errors

* test(memory): add keyword search and doctor unit tests

* test(memory): unskip e2e keyword tests without RUN_LIVE

* docs(handoff): add handoff and ADR for keyword search fix

* test(memory): remove unused var in keyword search test

* docs(handoff): set PR number to 124

* docs(project-map): update after structural changes (PR#124)

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-29 17:20:59 +03:00

96 lines
2.6 KiB
YAML

name: CI
on:
pull_request:
branches: [main]
paths-ignore: ['**/*.md', 'docs/**', 'LICENSE']
push:
branches: [main]
paths-ignore: ['**/*.md', 'docs/**', 'LICENSE']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
bootstrap:
runs-on: ubuntu-latest
outputs:
has_src: ${{ steps.check.outputs.has_src }}
steps:
- uses: actions/checkout@v4
- id: check
run: |
if [ -n "$(find src/ -name '*.py' -print -quit 2>/dev/null)" ]; then
echo "has_src=true" >> $GITHUB_OUTPUT
else
echo "has_src=false" >> $GITHUB_OUTPUT
fi
- run: echo "CI bootstrap OK"
lint:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
- run: uv sync --extra dev
- run: uv run ruff check src/ tests/ .opencode/scripts/
- run: uv run ruff format --check src/ tests/ .opencode/scripts/
typecheck:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
- run: uv sync --extra dev
- run: uv run mypy src/
test:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: sudo apt-get update && sudo apt-get install -y ripgrep
- run: npm ci
working-directory: .opencode
- uses: astral-sh/setup-uv@v3
- run: uv sync --extra dev --python ${{ matrix.python }}
- run: uv run --python ${{ matrix.python }} pytest
complexity:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
- run: uv sync --extra dev
- run: uv run xenon --max-absolute B --max-modules A --max-average A src/