Plexe Version Check workflow (plexe-ai/plexe)
The Plexe Version Check workflow from plexe-ai/plexe, explained and optimized by Latchkey.
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.
What it does
This is the Plexe Version Check workflow from the plexe-ai/plexe 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: Plexe Version Check
on:
pull_request:
branches: [main]
jobs:
check-version-bump:
name: Verify Version Bump
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch main branch
run: git fetch origin main:main
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install packaging module
run: pip install packaging
- name: Check for changes in plexe/
id: check-changes
run: |
if git diff --name-only origin/main...HEAD | grep '^plexe/' | grep -vq 'CODE_INDEX.md$'; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "✅ Changes detected in plexe/ (excluding auto-generated files)"
else
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "ℹ️ No relevant changes detected in plexe/"
fi
- name: Verify version bump
if: steps.check-changes.outputs.has_changes == 'true'
run: |
# Extract version from current branch
CURRENT_VERSION=$(python3 -c "
import tomllib
import sys
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
# Try old Poetry format first, then new PEP 621 format
if 'tool' in data and 'poetry' in data['tool'] and 'version' in data['tool']['poetry']:
print(data['tool']['poetry']['version'])
elif 'project' in data and 'version' in data['project']:
print(data['project']['version'])
else:
print('❌ Error: Could not find version in pyproject.toml', file=sys.stderr)
print('Expected tool.poetry.version or project.version', file=sys.stderr)
sys.exit(1)
")
# Extract version from main branch
MAIN_VERSION=$(git show origin/main:pyproject.toml | python3 -c "
import tomllib
import sys
data = tomllib.loads(sys.stdin.read())
# Try old Poetry format first, then new PEP 621 format
if 'tool' in data and 'poetry' in data['tool'] and 'version' in data['tool']['poetry']:
print(data['tool']['poetry']['version'])
elif 'project' in data and 'version' in data['project']:
print(data['project']['version'])
else:
print('❌ Error: Could not find version in origin/main pyproject.toml', file=sys.stderr)
print('Expected tool.poetry.version or project.version', file=sys.stderr)
sys.exit(1)
")
echo "Current branch version: $CURRENT_VERSION"
echo "Main branch version: $MAIN_VERSION"
# Parse versions and compare
python3 << EOF
from packaging import version
current = version.parse("$CURRENT_VERSION")
main = version.parse("$MAIN_VERSION")
if current <= main:
print(f"❌ ERROR: Version must be incremented!")
print(f" Current: {current}")
print(f" Main: {main}")
print(f"")
print(f"Please bump the version in pyproject.toml")
exit(1)
else:
print(f"✅ Version properly incremented from {main} to {current}")
exit(0)
EOF
- name: Version check passed
if: steps.check-changes.outputs.has_changes == 'false'
run: |
echo "✅ No changes detected in plexe/, version check skipped"
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: Plexe Version Check on: pull_request: branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: check-version-bump: timeout-minutes: 30 name: Verify Version Bump runs-on: latchkey-small permissions: contents: read steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Fetch main branch run: git fetch origin main:main - name: Set up Python uses: actions/setup-python@v5 with: cache: 'pip' python-version: '3.12' - name: Install packaging module run: pip install packaging - name: Check for changes in plexe/ id: check-changes run: | if git diff --name-only origin/main...HEAD | grep '^plexe/' | grep -vq 'CODE_INDEX.md$'; then echo "has_changes=true" >> $GITHUB_OUTPUT echo "✅ Changes detected in plexe/ (excluding auto-generated files)" else echo "has_changes=false" >> $GITHUB_OUTPUT echo "ℹ️ No relevant changes detected in plexe/" fi - name: Verify version bump if: steps.check-changes.outputs.has_changes == 'true' run: | # Extract version from current branch CURRENT_VERSION=$(python3 -c " import tomllib import sys with open('pyproject.toml', 'rb') as f: data = tomllib.load(f) # Try old Poetry format first, then new PEP 621 format if 'tool' in data and 'poetry' in data['tool'] and 'version' in data['tool']['poetry']: print(data['tool']['poetry']['version']) elif 'project' in data and 'version' in data['project']: print(data['project']['version']) else: print('❌ Error: Could not find version in pyproject.toml', file=sys.stderr) print('Expected tool.poetry.version or project.version', file=sys.stderr) sys.exit(1) ") # Extract version from main branch MAIN_VERSION=$(git show origin/main:pyproject.toml | python3 -c " import tomllib import sys data = tomllib.loads(sys.stdin.read()) # Try old Poetry format first, then new PEP 621 format if 'tool' in data and 'poetry' in data['tool'] and 'version' in data['tool']['poetry']: print(data['tool']['poetry']['version']) elif 'project' in data and 'version' in data['project']: print(data['project']['version']) else: print('❌ Error: Could not find version in origin/main pyproject.toml', file=sys.stderr) print('Expected tool.poetry.version or project.version', file=sys.stderr) sys.exit(1) ") echo "Current branch version: $CURRENT_VERSION" echo "Main branch version: $MAIN_VERSION" # Parse versions and compare python3 << EOF from packaging import version current = version.parse("$CURRENT_VERSION") main = version.parse("$MAIN_VERSION") if current <= main: print(f"❌ ERROR: Version must be incremented!") print(f" Current: {current}") print(f" Main: {main}") print(f"") print(f"Please bump the version in pyproject.toml") exit(1) else: print(f"✅ Version properly incremented from {main} to {current}") exit(0) EOF - name: Version check passed if: steps.check-changes.outputs.has_changes == 'false' run: | echo "✅ No changes detected in plexe/, version check skipped"
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - 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 per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.