Repository navigation
refactor(cli): organize doctor checks and use fix flag #4781
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| # Pull requests only. GitHub runs PR checks on the merge result, so a push | |
| # build on main would re-test content that the release / feature PR already | |
| # proved green. | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| name: "Python ${{ matrix.python-version }}" | |
| runs-on: ubuntu-latest | |
| # Post-release main → develop sync PRs carry main's already-tested tree and | |
| # are auto-merged by the bot before checks finish. See sync-main-to-develop. | |
| if: ${{ !startsWith(github.head_ref, 'chore/sync-develop-after-') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: make install | |
| - name: Lint | |
| run: make lint | |
| - name: Type check | |
| run: make typecheck | |
| - name: Test | |
| run: make test PYTEST_JOBS=logical | |
| dashboard: | |
| name: Dashboard | |
| runs-on: ubuntu-latest | |
| if: ${{ !startsWith(github.head_ref, 'chore/sync-develop-after-') }} | |
| defaults: | |
| run: | |
| working-directory: dashboard | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| # Same Node as deploy/docker/Dockerfile and release.yml. | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: dashboard/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Type check | |
| run: npx tsc -b | |
| - name: Test | |
| run: npm test | |
| # `make install` follows uv.lock. A merged PR can still fail | |
| # `pip install octop` when dependency ranges resolve differently in a clean | |
| # environment. Build the wheel, install it with pip, and verify the | |
| # published console command from an empty environment. | |
| command-install: | |
| name: Command install (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| if: ${{ !startsWith(github.head_ref, 'chore/sync-develop-after-') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Build wheel | |
| run: uv build --wheel | |
| - name: Install the wheel with pip (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| set -euo pipefail | |
| uv venv --no-project --python 3.12 --seed /tmp/octop-install | |
| wheels=(dist/octop-*.whl) | |
| if [ "${#wheels[@]}" -ne 1 ]; then | |
| echo "expected one wheel, found: ${wheels[*]}" | |
| exit 1 | |
| fi | |
| /tmp/octop-install/bin/python -m pip install --upgrade pip | |
| /tmp/octop-install/bin/python -m pip install "${wheels[0]}" | |
| - name: Install the wheel with pip (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = "Stop" | |
| uv venv --no-project --python 3.12 --seed .octop-install | |
| $wheels = @(Get-ChildItem -Path dist -Filter "octop-*.whl") | |
| if ($wheels.Count -ne 1) { | |
| throw "expected one wheel, found: $($wheels.Name -join ', ')" | |
| } | |
| .\.octop-install\Scripts\python.exe -m pip install --upgrade pip | |
| .\.octop-install\Scripts\python.exe -m pip install $wheels[0].FullName | |
| - name: Verify the installed command (Linux) | |
| if: runner.os == 'Linux' | |
| run: /tmp/octop-install/bin/octop --help | |
| - name: Verify the installed command (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: .\.octop-install\Scripts\octop.exe --help | |
| helm: | |
| name: Helm chart | |
| runs-on: ubuntu-latest | |
| if: ${{ !startsWith(github.head_ref, 'chore/sync-develop-after-') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: v3.17.3 | |
| - name: Lint and render | |
| run: | | |
| set -euo pipefail | |
| helm lint deploy/helm/octop | |
| helm template octop deploy/helm/octop -n octop >/dev/null | |
| helm template octop deploy/helm/octop -n octop \ | |
| -f deploy/helm/octop/values.example.yaml >/dev/null | |
| helm template octop deploy/helm/octop -n octop \ | |
| --set postgresql.enabled=false \ | |
| --set database.host=pg.example.com >/dev/null | |
| if helm template octop deploy/helm/octop -n octop --set postgresql.enabled=false >/dev/null 2>/tmp/helm-err; then | |
| echo "expected a missing database.host to fail" | |
| exit 1 | |
| fi | |
| test-windows: | |
| name: Windows / Python 3.12 | |
| runs-on: windows-latest | |
| if: ${{ !startsWith(github.head_ref, 'chore/sync-develop-after-') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: make install | |
| - name: Lint | |
| run: make lint | |
| - name: Type check | |
| run: make typecheck | |
| - name: Test | |
| run: make test PYTEST_JOBS=logical | |
| live-tests: | |
| name: "Live tests (real credentials)" | |
| runs-on: ubuntu-latest | |
| # Only the main repo may access secrets; fork PRs get none and must skip. | |
| if: >- | |
| github.event.pull_request.head.repo.full_name == github.repository && | |
| !startsWith(github.head_ref, 'chore/sync-develop-after-') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: make install | |
| # Secrets are injected as env vars. Missing secrets => empty values => | |
| # the live tests auto-skip (CI stays green). Never `echo`/print secrets. | |
| - name: Run live tests | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.LIVE_OPENAI_API_KEY }} | |
| OPENAI_BASE_URL: ${{ secrets.LIVE_OPENAI_BASE_URL }} | |
| OPENAI_MODEL_NAME: ${{ secrets.LIVE_OPENAI_MODEL_NAME }} | |
| OSS_KIND: ${{ secrets.LIVE_OSS_KIND }} | |
| OSS_ENDPOINT: ${{ secrets.LIVE_OSS_ENDPOINT }} | |
| OSS_ACCESS_KEY: ${{ secrets.LIVE_OSS_ACCESS_KEY }} | |
| OSS_SECRET_KEY: ${{ secrets.LIVE_OSS_SECRET_KEY }} | |
| OSS_BUCKET: ${{ secrets.LIVE_OSS_BUCKET }} | |
| OSS_REGION: ${{ secrets.LIVE_OSS_REGION }} | |
| OSS_PREFIX: ${{ secrets.LIVE_OSS_PREFIX }} | |
| ALI_OSS_KIND: ${{ secrets.LIVE_ALI_OSS_KIND }} | |
| ALI_OSS_ENDPOINT: ${{ secrets.LIVE_ALI_OSS_ENDPOINT }} | |
| ALI_OSS_ACCESS_KEY: ${{ secrets.LIVE_ALI_OSS_ACCESS_KEY }} | |
| ALI_OSS_SECRET_KEY: ${{ secrets.LIVE_ALI_OSS_SECRET_KEY }} | |
| ALI_OSS_BUCKET: ${{ secrets.LIVE_ALI_OSS_BUCKET }} | |
| ALI_OSS_REGION: ${{ secrets.LIVE_ALI_OSS_REGION }} | |
| ALI_OSS_PREFIX: ${{ secrets.LIVE_ALI_OSS_PREFIX }} | |
| CONNECTOR_TENCENT_DOCS_TOKEN: ${{ secrets.LIVE_CONNECTOR_TENCENT_DOCS_TOKEN }} | |
| CONNECTOR_TENCENT_MEETING_TOKEN: ${{ secrets.LIVE_CONNECTOR_TENCENT_MEETING_TOKEN }} | |
| CONNECTOR_TENCENT_WEIYUN_TOKEN: ${{ secrets.LIVE_CONNECTOR_TENCENT_WEIYUN_TOKEN }} | |
| CONNECTOR_YOUDAO_NOTE_TOKEN: ${{ secrets.LIVE_CONNECTOR_YOUDAO_NOTE_TOKEN }} | |
| CONNECTOR_TENCENT_NEWS_TOKEN: ${{ secrets.LIVE_CONNECTOR_TENCENT_NEWS_TOKEN }} | |
| CONNECTOR_WECHAT_READING_TOKEN: ${{ secrets.LIVE_CONNECTOR_WECHAT_READING_TOKEN }} | |
| CONNECTOR_QQ_MUSIC_TOKEN: ${{ secrets.LIVE_CONNECTOR_QQ_MUSIC_TOKEN }} | |
| CONNECTOR_FLIGGY_TOKEN: ${{ secrets.LIVE_CONNECTOR_FLIGGY_TOKEN }} | |
| CONNECTOR_BAIDU_MAP_TOKEN: ${{ secrets.LIVE_CONNECTOR_BAIDU_MAP_TOKEN }} | |
| CONNECTOR_CTRIP_WENDAO_TOKEN: ${{ secrets.LIVE_CONNECTOR_CTRIP_WENDAO_TOKEN }} | |
| CONNECTOR_TENCENT_IMA_TOKEN: ${{ secrets.LIVE_CONNECTOR_TENCENT_IMA_TOKEN }} | |
| CONNECTOR_TENCENT_IMA_CLIENT_ID: ${{ secrets.LIVE_CONNECTOR_TENCENT_IMA_CLIENT_ID }} | |
| CONNECTOR_TENCENT_LEXIANG_TOKEN: ${{ secrets.LIVE_CONNECTOR_TENCENT_LEXIANG_TOKEN }} | |
| CONNECTOR_TENCENT_LEXIANG_COMPANY_FROM: ${{ secrets.LIVE_CONNECTOR_TENCENT_LEXIANG_COMPANY_FROM }} | |
| CONNECTOR_MEITUAN_TRAVEL_TOKEN: ${{ secrets.LIVE_CONNECTOR_MEITUAN_TRAVEL_TOKEN }} | |
| CONNECTOR_YUANDIAN_TOKEN: ${{ secrets.LIVE_CONNECTOR_YUANDIAN_TOKEN }} | |
| # Channel probes (WeChat iLink + Feishu) | |
| WEIXIN_BOT_UIN: ${{ secrets.LIVE_WEIXIN_BOT_UIN }} | |
| WEIXIN_TOKEN: ${{ secrets.LIVE_WEIXIN_TOKEN }} | |
| WEIXIN_BASE_URL: ${{ secrets.LIVE_WEIXIN_BASE_URL }} | |
| FEISHU_APP_ID: ${{ secrets.LIVE_FEISHU_APP_ID }} | |
| FEISHU_APP_SECRET: ${{ secrets.LIVE_FEISHU_APP_SECRET }} | |
| run: make test-live |