Files
2dph/.github/workflows/ci.yml
T
eSlider 2332613c43
Tests / Test (push) Skipped
Tests / Release (semver) (push) Skipped
Tests / Test (pull_request) Failing after 39s
Tests / Release (semver) (pull_request) Skipped
ci: point eval at the checkout and keep DevOps in the corpus.
/tmp/brain-eval cannot walk up to var/kb.lbug; KB_ROOT is required.
Recall fragments must exist in README/docs so a repo-only rebuild gates.
2026-08-14 11:00:39 +01:00

110 lines
3.0 KiB
YAML

name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
- name: Sync toolchain (ladybug, model2vec, mistune)
run: uv sync --frozen
- name: Shell syntax check
run: |
bash -n bin/db/psql-yq
bash -n bin/db/ssh-tunnel
bash -n bin/docker-entrypoint
bash -n bin/kb/search
bash -n bin/cgo/zig
sh -n bin/cgo/zcc
sh -n bin/cgo/zc++
- name: Python unit tests (offline, vendored tools)
run: |
uv run python -m unittest discover -s bin/tools -t .
- name: Go tests (root module, no ladybug cgo)
run: |
go vet ./...
go test ./... -count=1
- name: brain ranking tests (no cgo / no ladybug)
run: go test ./internal/brain/rank -count=1
- name: facts/audit self (lexicon consistency, no network)
run: ./bin/facts/audit self
- name: CGO via Zig (compile brain/search + eval)
run: |
chmod +x bin/cgo/zig bin/cgo/zcc bin/cgo/zc++
bin/cgo/zig go build -tags system_ladybug -o /tmp/brain-search ./bin/brain/search.go
bin/cgo/zig go build -tags 'system_ladybug,brain_eval' -o /tmp/brain-eval ./bin/brain/eval.go
- uses: actions/cache@v4
with:
path: ~/.cache/huggingface
key: ${{ runner.os }}-hf-potion-multilingual-128M
- name: recall@5 SoT (Zig bin/brain/eval.go)
run: |
uv run python bin/kb/index --rebuild --json
KB_ROOT="$PWD" /tmp/brain-eval --json
release:
name: Release (semver)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compute next semver from conventional commits
id: semver
run: |
bin/ci/semver > /tmp/next
echo "next=$(cat /tmp/next)" >> "$GITHUB_OUTPUT"
- name: Create tag + GitHub Release
if: steps.semver.outputs.next != 'none'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.semver.outputs.next }}
run: |
set -euo pipefail
PREV=$(git tag --sort=-v:refname | grep -v "^$TAG$" | head -1 || true)
RANGE=""
[ -n "$PREV" ] && RANGE="$PREV..HEAD"
{ echo "2dph $TAG — changes from conventional commits";
git log --format='- %s' $RANGE | head -40; } > /tmp/notes
gh release create "$TAG" \
--repo "${{ github.repository }}" \
--target "$GITHUB_SHA" \
--title "$TAG" \
--notes-file /tmp/notes