Skip to content

Update test-aoai-response.yml #2

Update test-aoai-response.yml

Update test-aoai-response.yml #2

- name: 🧪 Run script & build report

Check failure on line 1 in .github/workflows/test-aoai-response.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-aoai-response.yml

Invalid workflow file

You have an error in your yaml syntax on line 1
id: test
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_V1_API_ENDPOINT: ${{ secrets.AZURE_OPENAI_V1_API_ENDPOINT }}
AZURE_OPENAI_API_MODEL: ${{ secrets.AZURE_OPENAI_API_MODEL }}
run: |
python - <<'PY'
import datetime, json, pathlib, subprocess, sys
# Execute your existing script and capture its stdout / exit code
proc = subprocess.run(
[sys.executable, "responses-basic-aoai-v1.py"],
capture_output=True, text=True
)
output = proc.stdout.strip()
error_code = proc.returncode
passed = bool(output) and error_code == 0 # customise as needed
result = {
"run_timestamp_utc": datetime.datetime.utcnow()
.isoformat(timespec="seconds") + "Z",
"output": output,
"pass": passed,
"error_code": error_code,
}
pathlib.Path("aoai_test_result.json").write_text(
json.dumps(result, indent=2), encoding="utf-8"
)
if not passed:
sys.exit(error_code or 1)
PY