Run Examples on Tag workflow (google-antigravity/antigravity-sdk-python)
The Run Examples on Tag workflow from google-antigravity/antigravity-sdk-python, 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 Run Examples on Tag workflow from the google-antigravity/antigravity-sdk-python 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: Run Examples on Tag
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
run-examples:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install google-antigravity
- name: Run examples
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
cd examples/getting_started
for f in *.py; do
if [ "$f" = "human_in_the_loop.py" ]; then
echo "Skipping interactive script: $f"
continue
fi
echo "Running $f"
python "$f" || exit 1
done
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 Examples on Tag on: push: tags: - '*' workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: run-examples: timeout-minutes: 30 strategy: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: cache: 'pip' python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip pip install google-antigravity - name: Run examples env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} run: | cd examples/getting_started for f in *.py; do if [ "$f" = "human_in_the_loop.py" ]; then echo "Skipping interactive script: $f" continue fi echo "Running $f" python "$f" || exit 1 done
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 (2 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.