-
Notifications
You must be signed in to change notification settings - Fork 1.4k
71 lines (62 loc) · 2.08 KB
/
Copy pathrun_examples.yml
File metadata and controls
71 lines (62 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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" || { echo "❌ $f failed with exit code $?"; exit 1; }
echo "✅ $f passed"
done