Skip to content
Latchkey

Windows tests workflow (python-lsp/python-lsp-server)

The Windows tests workflow from python-lsp/python-lsp-server, explained and optimized by Latchkey.

A

CI health: A - excellent

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: python-lsp/python-lsp-server.github/workflows/test-win.ymlLicense MITView source

What it does

This is the Windows tests workflow from the python-lsp/python-lsp-server repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

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

The workflow

workflow (.yml)
name: Windows tests

on:
  push:
    branches:
      - develop

  pull_request:
    branches:
      - '*'

concurrency:
  group: test-win-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    name: Win Py${{ matrix.PYTHON_VERSION }}
    runs-on: windows-latest
    env:
      CI: 'true'
      OS: 'win'
      PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
    strategy:
      fail-fast: false
      matrix:
        PYTHON_VERSION: ['3.14', '3.12', '3.9']
    timeout-minutes: 10
    steps:
      - uses: actions/cache@v4
        with:
          path: ~\AppData\Local\pip\Cache
          key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{ hashFiles('pyproject.toml') }}
          restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.PYTHON_VERSION }}
          architecture: 'x64'
      - run: python -m pip install --upgrade pip setuptools
      - run: pip install -e .[all,test]
      - name: Show test environment
        run: pip list
      - run: pytest --color=yes -v test/

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: Windows tests
 
on:
  push:
    branches:
      - develop
 
  pull_request:
    branches:
      - '*'
 
concurrency:
  group: test-win-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build:
    name: Win Py${{ matrix.PYTHON_VERSION }}
    runs-on: windows-latest
    env:
      CI: 'true'
      OS: 'win'
      PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
    strategy:
      fail-fast: false
      matrix:
        PYTHON_VERSION: ['3.14', '3.12', '3.9']
    timeout-minutes: 10
    steps:
      - uses: actions/cache@v4
        with:
          path: ~\AppData\Local\pip\Cache
          key: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-${{ hashFiles('pyproject.toml') }}
          restore-keys: ${{ runner.os }}-${{ matrix.PYTHON_VERSION }}-pip-
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          cache: 'pip'
          python-version: ${{ matrix.PYTHON_VERSION }}
          architecture: 'x64'
      - run: python -m pip install --upgrade pip setuptools
      - run: pip install -e .[all,test]
      - name: Show test environment
        run: pip list
      - run: pytest --color=yes -v test/
 

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 (3 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