xmlschema workflow (sissaschool/xmlschema)
The xmlschema workflow from sissaschool/xmlschema, explained and optimized by Latchkey.
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 →What it does
This is the xmlschema workflow from the sissaschool/xmlschema 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
name: xmlschema
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15.0-beta.3", "pypy-3.10", "pypy-3.11"]
exclude:
- os: macos-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.10"
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install pip and setuptools
run: |
python -m pip install --upgrade pip
pip install setuptools
- name: Install lxml optional dependency
if: |
matrix.python-version != '3.15.0-beta.3' &&
matrix.python-version != 'pypy-3.10' &&
matrix.python-version != 'pypy-3.11' &&
matrix.python-version != '3.14t'
run: |
pip install lxml
- name: Install lxml optional dependency for PyPy 3.10 on Ubuntu
if: |
matrix.os == 'ubuntu-latest' &&
matrix.python-version != 'pypy-3.10'
run: |
sudo apt install -y libxml2-dev libxslt-dev python3-dev
pip install lxml
- name: Install other optional dependencies
run: pip install jinja2
- name: Test with unittest
run: |
pip install .
python -m unittest
- name: Lint with flake8
run: |
pip install flake8
flake8 xmlschema --max-line-length=100 --statistics
- name: Lint with mypy==2.1.0
if: ${{ matrix.python-version != 'pypy-3.10' && matrix.python-version != 'pypy-3.11' }}
run: |
pip install mypy==2.1.0 xmlschema lxml-stubs
mypy --show-error-codes --strict xmlschema
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: xmlschema on: push: branches: [master, develop] pull_request: branches: [master, develop] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15.0-beta.3", "pypy-3.10", "pypy-3.11"] exclude: - os: macos-latest python-version: "3.10" - os: windows-latest python-version: "3.10" steps: - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: cache: 'pip' python-version: ${{ matrix.python-version }} - name: Install pip and setuptools run: | python -m pip install --upgrade pip pip install setuptools - name: Install lxml optional dependency if: | matrix.python-version != '3.15.0-beta.3' && matrix.python-version != 'pypy-3.10' && matrix.python-version != 'pypy-3.11' && matrix.python-version != '3.14t' run: | pip install lxml - name: Install lxml optional dependency for PyPy 3.10 on Ubuntu if: | matrix.os == 'ubuntu-latest' && matrix.python-version != 'pypy-3.10' run: | sudo apt install -y libxml2-dev libxslt-dev python3-dev pip install lxml - name: Install other optional dependencies run: pip install jinja2 - name: Test with unittest run: | pip install . python -m unittest - name: Lint with flake8 run: | pip install flake8 flake8 xmlschema --max-line-length=100 --statistics - name: Lint with mypy==2.1.0 if: ${{ matrix.python-version != 'pypy-3.10' && matrix.python-version != 'pypy-3.11' }} run: | pip install mypy==2.1.0 xmlschema lxml-stubs mypy --show-error-codes --strict xmlschema
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.
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:
- Dependency installs
This workflow runs 1 job (27 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.