CI workflow (RUC-NLPIR/Arbor)
The CI workflow from RUC-NLPIR/Arbor, explained and optimized by Latchkey.
CI health: B - good
Point runs-on at Latchkey and get job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the CI workflow from the RUC-NLPIR/Arbor 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
name: CI
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs on the same ref to save CI minutes.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dev dependencies
run: uv sync --group dev
- name: Ruff (lint) - blocking
run: uv run ruff check src/ tests/
- name: Mypy (type check) - advisory
# Non-blocking for now: the codebase is large and largely untyped.
# The step still surfaces type issues in the logs; tighten over time.
continue-on-error: true
run: uv run mypy src/
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
# Also run on macOS for the oldest and newest Python - enough to catch
# platform issues in the real-git worktree tests without paying the 10x
# macOS-runner cost on every Python version. (Windows is omitted: the
# worktree helpers build shell commands with POSIX shlex quoting.)
include:
- os: macos-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.13"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dev dependencies
# Include the optional `mcp` extra so the `arbor mcp` server, the
# session-backed WebUI, and the plugin-manifest tests are exercised.
run: uv sync --group dev --extra mcp
- name: Pytest
run: uv run pytest
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: CI on: push: branches: [main] pull_request: # Cancel superseded runs on the same ref to save CI minutes. concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: lint: timeout-minutes: 30 runs-on: latchkey-small steps: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - name: Install dev dependencies run: uv sync --group dev - name: Ruff (lint) - blocking run: uv run ruff check src/ tests/ - name: Mypy (type check) - advisory # Non-blocking for now: the codebase is large and largely untyped. # The step still surfaces type issues in the logs; tighten over time. continue-on-error: true run: uv run mypy src/ test: timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] python-version: ["3.10", "3.11", "3.12", "3.13"] # Also run on macOS for the oldest and newest Python - enough to catch # platform issues in the real-git worktree tests without paying the 10x # macOS-runner cost on every Python version. (Windows is omitted: the # worktree helpers build shell commands with POSIX shlex quoting.) include: - os: macos-latest python-version: "3.10" - os: macos-latest python-version: "3.13" steps: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - name: Install dev dependencies # Include the optional `mcp` extra so the `arbor mcp` server, the # session-backed WebUI, and the plugin-manifest tests are exercised. run: uv sync --group dev --extra mcp - name: Pytest run: uv run pytest
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
This workflow runs 2 jobs (5 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.