Skip to content

Suppress pyrefly errors #13

Suppress pyrefly errors

Suppress pyrefly errors #13

Workflow file for this run

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
# Resolve target SDK version from tag or pyproject.toml
if [[ "${GITHUB_REF_NAME}" =~ ^v[0-9] ]]; then
TARGET_VERSION="${GITHUB_REF_NAME#v}"
elif [ -f pyproject.toml ]; then
TARGET_VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)
fi
if [ -n "${TARGET_VERSION}" ]; then
PACKAGE_SPEC="google-antigravity==${TARGET_VERSION}"
echo "Waiting for ${PACKAGE_SPEC} to become available on PyPI..."
INSTALLED=0
for i in $(seq 1 60); do
if pip install --no-cache-dir "${PACKAGE_SPEC}"; then
echo "Successfully installed ${PACKAGE_SPEC} on attempt $i"
INSTALLED=1
break
fi
echo "${PACKAGE_SPEC} not yet available on PyPI. Retrying in 30s (attempt $i/60)..."
sleep 30
done
if [ "${INSTALLED}" -ne 1 ]; then
echo "Error: Timed out waiting for ${PACKAGE_SPEC} on PyPI after 30 minutes."
exit 1
fi
else
pip install google-antigravity
fi
- 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