Merge main into codex/agentmint-work #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Example Execution | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| examples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Run examples in fresh virtual environments | |
| run: | | |
| set -euo pipefail | |
| found=0 | |
| failed=0 | |
| for example in examples/*; do | |
| [ -d "$example" ] || continue | |
| entry="" | |
| if [ -f "$example/run_demo.py" ]; then | |
| entry="run_demo.py" | |
| elif [ -f "$example/main.py" ]; then | |
| entry="main.py" | |
| else | |
| continue | |
| fi | |
| found=1 | |
| echo "::group::$example" | |
| venv="$(mktemp -d)" | |
| python -m venv "$venv" | |
| "$venv/bin/python" -m pip install --upgrade pip | |
| "$venv/bin/python" -m pip install -e . | |
| if [ -f "$example/requirements.txt" ]; then | |
| "$venv/bin/python" -m pip install -r "$example/requirements.txt" | |
| fi | |
| if ! (cd "$example" && "$venv/bin/python" "$entry"); then | |
| failed=1 | |
| echo "FAIL $example" | |
| else | |
| echo "PASS $example" | |
| fi | |
| rm -rf "$venv" | |
| echo "::endgroup::" | |
| done | |
| if [ "$found" -eq 0 ]; then | |
| echo "No examples with run_demo.py or main.py found." | |
| fi | |
| exit "$failed" |