Skip to content
Latchkey

Run Tests workflow (blazickjp/arxiv-mcp-server)

The Run Tests workflow from blazickjp/arxiv-mcp-server, explained and optimized by Latchkey.

D

CI health: D - needs work

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: blazickjp/arxiv-mcp-server.github/workflows/tests.ymlLicense Apache-2.0View source

What it does

This is the Run Tests workflow from the blazickjp/arxiv-mcp-server 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: Run Tests

on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
    types: [opened, synchronize, reopened]

jobs:
  test:
    strategy:
      matrix:
        python-version: ["3.11", "3.12"]
        os: [ubuntu-latest, windows-latest, macos-latest]

    runs-on: ${{ matrix.os }}
    
    steps:
    - uses: actions/checkout@v4

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install uv (Linux/macOS)
      if: runner.os != 'Windows'
      run: |
        curl -LsSf https://astral.sh/uv/install.sh | sh
        echo "$HOME/.cargo/bin" >> $GITHUB_PATH
        
    - name: Install uv (Windows)
      if: runner.os == 'Windows'
      run: |
        # Install uv
        iwr -useb https://astral.sh/uv/install.ps1 | iex
        # Add uv to PATH
        echo "$HOME\.uv\bin" >> $GITHUB_PATH

    - name: Install dependencies
      run: |
        uv pip install --system pytest pytest-cov pytest-asyncio
        uv pip install --system -e ".[test]"
        # If you don't have a [test] extra, use:
        # uv pip install --system -r requirements-test.txt
        # or just:
        # uv pip install --system -e .

    # Run tests differently based on platform
    - name: Run tests on Linux/macOS
      if: runner.os != 'Windows'
      run: |
        pytest --cov=./ --cov-report=xml -v
        
    - name: Run tests on Windows
      if: runner.os == 'Windows' 
      run: |
        pytest --cov=./ --cov-report=xml -v

        

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: Run Tests
 
on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
    types: [opened, synchronize, reopened]
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  test:
    timeout-minutes: 30
    strategy:
      matrix:
        python-version: ["3.11", "3.12"]
        os: [ubuntu-latest, windows-latest, macos-latest]
 
    runs-on: ${{ matrix.os }}
    
    steps:
    - uses: actions/checkout@v4
 
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        cache: 'pip'
        python-version: ${{ matrix.python-version }}
 
    - name: Install uv (Linux/macOS)
      if: runner.os != 'Windows'
      run: |
        curl -LsSf https://astral.sh/uv/install.sh | sh
        echo "$HOME/.cargo/bin" >> $GITHUB_PATH
        
    - name: Install uv (Windows)
      if: runner.os == 'Windows'
      run: |
        # Install uv
        iwr -useb https://astral.sh/uv/install.ps1 | iex
        # Add uv to PATH
        echo "$HOME\.uv\bin" >> $GITHUB_PATH
 
    - name: Install dependencies
      run: |
        uv pip install --system pytest pytest-cov pytest-asyncio
        uv pip install --system -e ".[test]"
        # If you don't have a [test] extra, use:
        # uv pip install --system -r requirements-test.txt
        # or just:
        # uv pip install --system -e .
 
    # Run tests differently based on platform
    - name: Run tests on Linux/macOS
      if: runner.os != 'Windows'
      run: |
        pytest --cov=./ --cov-report=xml -v
        
    - name: Run tests on Windows
      if: runner.os == 'Windows' 
      run: |
        pytest --cov=./ --cov-report=xml -v
 
        

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

Actions used in this workflow