Files
yawan f7fc992f57
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
WeKnora deployment source with the reviewed wiki identity, summary and recovery fixes
2026-09-22 16:19:06 +08:00

108 lines
3.2 KiB
YAML

name: DocReader
on:
push:
branches: [main]
paths:
- "docreader/**"
- "go.mod"
- "go.sum"
- "testdata/**"
- "docker/Dockerfile.docreader"
- "docker/Dockerfile.odl-hybrid"
- ".github/workflows/docreader.yml"
pull_request:
paths:
- "docreader/**"
- "go.mod"
- "go.sum"
- "testdata/**"
- "docker/Dockerfile.docreader"
- "docker/Dockerfile.odl-hybrid"
- ".github/workflows/docreader.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
PYTHON_VERSION: "3.10.18"
GO_VERSION: "1.26"
GOPROXY: https://proxy.golang.org,direct
jobs:
verify:
name: Python tests and Go client tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: docreader/uv.lock
- name: Install Python dependencies
run: uv sync --project docreader --locked --no-dev --python ${{ env.PYTHON_VERSION }}
- name: Compile Python sources
run: uv run --project docreader --python ${{ env.PYTHON_VERSION }} python -m compileall -q docreader
- name: Run Python tests
run: uv run --project docreader --python ${{ env.PYTHON_VERSION }} python -m unittest discover -s docreader/tests -p "test_*.py" -v
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Download Go modules
run: go mod download
# TestReadURL drives the live WebParser (Playwright WebKit). Without the
# browser binary, scrape used to return "Error parsing web page: …" as
# markdown and the Go client treated that as success. After #2883 the
# parser raises, so CI must install WebKit the same way the image does.
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-webkit-${{ hashFiles('docreader/uv.lock') }}
- name: Install Playwright WebKit
run: uv run --project docreader --python ${{ env.PYTHON_VERSION }} python -m playwright install --with-deps webkit
- name: Start DocReader gRPC server
run: |
uv run --project docreader --python ${{ env.PYTHON_VERSION }} python -m docreader.main &
echo $! > /tmp/docreader.pid
for i in $(seq 1 30); do
if nc -z 127.0.0.1 50051 2>/dev/null; then
echo "DocReader gRPC server is ready"
exit 0
fi
sleep 1
done
echo "DocReader gRPC server failed to start"
exit 1
- name: Run Go client tests
run: go test ./docreader/client ./docreader/proto
- name: Stop DocReader gRPC server
if: always()
run: |
if [ -f /tmp/docreader.pid ]; then
kill "$(cat /tmp/docreader.pid)" 2>/dev/null || true
fi