Skip to content
Latchkey

CI Mainline workflow (noho/dayu-agent)

The CI Mainline workflow from noho/dayu-agent, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: noho/dayu-agent.github/workflows/ci-mainline.ymlLicense Apache-2.0View source

What it does

This is the CI Mainline workflow from the noho/dayu-agent repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: CI Mainline

on:
  push:
    branches: [main]
  workflow_dispatch:
    inputs:
      run_extended_integration:
        description: "是否运行扩展 integration 层"
        required: false
        default: false
        type: boolean
      platforms:
        description: "选择要运行的平台验证(不选则全部运行)"
        required: false
        type: choice
        multiple: true
        options:
          - linux-x64
          - windows-x64
          - macos-arm64
          - macos-x64
  schedule:
    - cron: "0 2 * * *"

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  pr-required-min-compat:
    name: pr-required min-compat (ubuntu-latest, py3.11)
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install minimum supported dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -e ".[test,dev,browser,web]" -c constraints/min-py311.txt

      - name: Run pyright
        run: pyright

      - name: Run required pytest lane
        run: pytest -q --timeout=60 -m "not integration and not slow and not e2e"

  pr-required-lock-smoke:
    name: pr-required lock-smoke (linux-x64, py3.11)
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt

      - name: Run required Docling integration smoke
        run: |
          pytest -q --timeout=120 \
            tests/engine/test_docling_processor_integration.py \
            tests/fins/test_docling_upload_service_integration.py \
            tests/engine/test_web_fetch_docling_integration.py

      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt
          platform-id: linux-x64

  extended-integration:
    name: extended integration (ubuntu-latest, py3.11)
    runs-on: ubuntu-latest
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        inputs.run_extended_integration == true)

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt

      - name: Run extended integration lane
        run: pytest -q --timeout=120 -m "integration and not e2e"

  full-platform-validation-linux-x64:
    name: full-platform-validation linux-x64 (py3.11)
    runs-on: ubuntu-latest
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'linux-x64') || inputs.platforms == ''))

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt

      - name: Run pyright
        run: pyright

      - name: Run full pytest lane
        run: pytest -q --timeout=60

      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt
          platform-id: linux-x64

  full-platform-validation-windows-x64:
    name: full-platform-validation windows-x64 (py3.11)
    runs-on: windows-latest
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'windows-x64') || inputs.platforms == ''))

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-windows-x64-py311.txt

      - name: Run pyright
        shell: bash
        run: pyright --pythonplatform Linux

      - name: Run full pytest lane
        run: pytest -q --timeout=60

      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-windows-x64-py311.txt
          platform-id: windows-x64

  full-platform-validation-macos-arm64:
    name: full-platform-validation macos-arm64 (py3.11)
    runs-on: macos-14
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'macos-arm64') || inputs.platforms == ''))

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-macos-arm64-py311.txt

      - name: Run pyright
        run: pyright

      - name: Run full pytest lane
        run: pytest -q --timeout=60

      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-macos-arm64-py311.txt
          platform-id: macos-arm64

  full-platform-validation-macos-x64:
    name: full-platform-validation macos-x64 (py3.11)
    runs-on: [self-hosted, macOS, X64]
    continue-on-error: true
    timeout-minutes: 30
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'macos-x64') || inputs.platforms == ''))

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip

      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-macos-x64-py311.txt

      - name: Run pyright
        run: pyright

      - name: Run full pytest lane
        run: pytest -q --timeout=60

      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-macos-x64-py311.txt
          platform-id: macos-x64

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: CI Mainline
 
on:
  push:
    branches: [main]
  workflow_dispatch:
    inputs:
      run_extended_integration:
        description: "是否运行扩展 integration 层"
        required: false
        default: false
        type: boolean
      platforms:
        description: "选择要运行的平台验证(不选则全部运行)"
        required: false
        type: choice
        multiple: true
        options:
          - linux-x64
          - windows-x64
          - macos-arm64
          - macos-x64
  schedule:
    - cron: "0 2 * * *"
 
concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  pr-required-min-compat:
    timeout-minutes: 30
    name: pr-required min-compat (ubuntu-latest, py3.11)
    runs-on: latchkey-small
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip
 
      - name: Install minimum supported dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -e ".[test,dev,browser,web]" -c constraints/min-py311.txt
 
      - name: Run pyright
        run: pyright
 
      - name: Run required pytest lane
        run: pytest -q --timeout=60 -m "not integration and not slow and not e2e"
 
  pr-required-lock-smoke:
    timeout-minutes: 30
    name: pr-required lock-smoke (linux-x64, py3.11)
    runs-on: latchkey-small
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip
 
      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt
 
      - name: Run required Docling integration smoke
        run: |
          pytest -q --timeout=120 \
            tests/engine/test_docling_processor_integration.py \
            tests/fins/test_docling_upload_service_integration.py \
            tests/engine/test_web_fetch_docling_integration.py
 
      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt
          platform-id: linux-x64
 
  extended-integration:
    timeout-minutes: 30
    name: extended integration (ubuntu-latest, py3.11)
    runs-on: latchkey-small
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        inputs.run_extended_integration == true)
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip
 
      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt
 
      - name: Run extended integration lane
        run: pytest -q --timeout=120 -m "integration and not e2e"
 
  full-platform-validation-linux-x64:
    timeout-minutes: 30
    name: full-platform-validation linux-x64 (py3.11)
    runs-on: latchkey-small
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'linux-x64') || inputs.platforms == ''))
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip
 
      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt
 
      - name: Run pyright
        run: pyright
 
      - name: Run full pytest lane
        run: pytest -q --timeout=60
 
      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-linux-x64-py311.txt
          platform-id: linux-x64
 
  full-platform-validation-windows-x64:
    timeout-minutes: 30
    name: full-platform-validation windows-x64 (py3.11)
    runs-on: windows-latest
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'windows-x64') || inputs.platforms == ''))
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip
 
      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-windows-x64-py311.txt
 
      - name: Run pyright
        shell: bash
        run: pyright --pythonplatform Linux
 
      - name: Run full pytest lane
        run: pytest -q --timeout=60
 
      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-windows-x64-py311.txt
          platform-id: windows-x64
 
  full-platform-validation-macos-arm64:
    timeout-minutes: 30
    name: full-platform-validation macos-arm64 (py3.11)
    runs-on: macos-14
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'macos-arm64') || inputs.platforms == ''))
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip
 
      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-macos-arm64-py311.txt
 
      - name: Run pyright
        run: pyright
 
      - name: Run full pytest lane
        run: pytest -q --timeout=60
 
      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-macos-arm64-py311.txt
          platform-id: macos-arm64
 
  full-platform-validation-macos-x64:
    name: full-platform-validation macos-x64 (py3.11)
    runs-on: [self-hosted, macOS, X64]
    continue-on-error: true
    timeout-minutes: 30
    if: >
      github.event_name == 'push' ||
      github.event_name == 'schedule' ||
      (github.event_name == 'workflow_dispatch' &&
        (contains(inputs.platforms, 'macos-x64') || inputs.platforms == ''))
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Set up Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
          cache: pip
 
      - name: Install locked dependencies
        uses: ./.github/actions/install-locked-env
        with:
          constraints-path: constraints/lock-macos-x64-py311.txt
 
      - name: Run pyright
        run: pyright
 
      - name: Run full pytest lane
        run: pytest -q --timeout=60
 
      - name: Build and smoke test offline bundle
        uses: ./.github/actions/build-and-smoke-offline-bundle
        with:
          constraints-path: constraints/lock-macos-x64-py311.txt
          platform-id: macos-x64
 

What changed

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 7 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow