Tests workflow (kayba-ai/agentic-context-engine)
The Tests workflow from kayba-ai/agentic-context-engine, explained and optimized by Latchkey.
CI health: F - at risk
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Tests workflow from the kayba-ai/agentic-context-engine 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: Tests
on:
push:
branches: [ main, develop, lanzelot-dev ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allow manual triggering
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.12'] # Matches pyproject.toml requires-python == 3.12.*
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --extra mcp --extra tracing
- name: Run tests with coverage
run: |
uv run pytest -m "not requires_api"
- name: Upload coverage reports (Linux only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
retention-days: 30
- name: Type checking (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
uv run mypy ace/ --ignore-missing-importsThe same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: Tests on: push: branches: [ main, develop, lanzelot-dev ] pull_request: branches: [ main ] workflow_dispatch: # Allow manual triggering concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.12'] # Matches pyproject.toml requires-python == 3.12.* steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: cache: 'pip' python-version: ${{ matrix.python-version }} - name: Install uv uses: astral-sh/setup-uv@v7 - name: Install dependencies run: uv sync --extra mcp --extra tracing - name: Run tests with coverage run: | uv run pytest -m "not requires_api" - name: Upload coverage reports (Linux only) if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' uses: actions/upload-artifact@v4 with: name: coverage-report path: htmlcov/ retention-days: 30 - name: Type checking (Linux only) if: matrix.os == 'ubuntu-latest' run: | uv run mypy ace/ --ignore-missing-imports
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- 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 1 job (3 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.