Skip to content
Latchkey

Pytest + Report workflow (splx-ai/agentic-radar)

The Pytest + Report workflow from splx-ai/agentic-radar, explained and optimized by Latchkey.

D

CI health: D - needs work

Point runs-on at Latchkey and get caching, run de-duplication, 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: splx-ai/agentic-radar.github/workflows/framework_unit_tests.ymlLicense Apache-2.0View source

What it does

This is the Pytest + Report workflow from the splx-ai/agentic-radar 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: Pytest + Report

on:
  pull_request:
    branches: [main]
    types: [opened, synchronize]

permissions:
  contents: write
  
env:
  POETRY_VERSION: 2.0.1

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout PR branch
      uses: actions/checkout@v3
      with:
        ref: ${{ github.head_ref }}
        token: ${{ secrets.GITHUB_TOKEN }}

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

    - name: Install poetry
      run: curl -sSL https://install.python-poetry.org | python3 - --version $POETRY_VERSION

    - name: Install dependencies
      run: | 
        poetry install

    - name: Run tests and generate JSON report
      run: |
        poetry run python -m pytest tests/unit_tests
      continue-on-error: true

    - name: Upload report as artifact
      uses: actions/upload-artifact@v4
      with:
        name: pytest-markdown-report
        path: test-report.md

    - name: Commit and push test report
      run: |
        git config user.name "github-actions[bot]"
        git config user.email "github-actions[bot]@users.noreply.github.com"
        if ! git diff --quiet HEAD test-report.md; then
          git add test-report.md
          git commit -m "chore(framework-support): update report [skip-ci]"
          git push origin ${{ github.head_ref }}
        else
          echo "No changes in test-report.md"
        fi
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The 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: Pytest + Report
 
on:
  pull_request:
    branches: [main]
    types: [opened, synchronize]
 
permissions:
  contents: write
  
env:
  POETRY_VERSION: 2.0.1
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  test:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
    - name: Checkout PR branch
      uses: actions/checkout@v3
      with:
        ref: ${{ github.head_ref }}
        token: ${{ secrets.GITHUB_TOKEN }}
 
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        cache: 'pip'
        python-version: '3.11'
 
    - name: Install poetry
      run: curl -sSL https://install.python-poetry.org | python3 - --version $POETRY_VERSION
 
    - name: Install dependencies
      run: | 
        poetry install
 
    - name: Run tests and generate JSON report
      run: |
        poetry run python -m pytest tests/unit_tests
      continue-on-error: true
 
    - name: Upload report as artifact
      uses: actions/upload-artifact@v4
      with:
        name: pytest-markdown-report
        path: test-report.md
 
    - name: Commit and push test report
      run: |
        git config user.name "github-actions[bot]"
        git config user.email "github-actions[bot]@users.noreply.github.com"
        if ! git diff --quiet HEAD test-report.md; then
          git add test-report.md
          git commit -m "chore(framework-support): update report [skip-ci]"
          git push origin ${{ github.head_ref }}
        else
          echo "No changes in test-report.md"
        fi
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow