# .github/workflows/voice-tests-curl.yml # The smallest possible gate: one curl call, no action, no CLI. # The server waits for the run (up to 900 s) and answers: # 200 passed, 412 failed (curl --fail makes the step fail), 202 still running. name: Voice tests (curl) on: [workflow_dispatch] jobs: callqa: runs-on: ubuntu-latest steps: - name: Run the CallQA suite and gate on the score env: CALLQA_API_KEY: ${{ secrets.CALLQA_API_KEY }} SCENARIO: ${{ vars.CALLQA_SCENARIO_ID }} run: | code=$(curl -sS -o run.json -w '%{http_code}' -X POST \ -H "Authorization: Bearer $CALLQA_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"version\": \"$GITHUB_SHA\", \"git_sha\": \"$GITHUB_SHA\", \"git_ref\": \"$GITHUB_REF_NAME\", \"tags\": [\"ci\"]}" \ --max-time 960 \ "https://app.callqa.dev/api/v1/scenarios/$SCENARIO/runs?wait=true&timeout=900&threshold=80") cat run.json case "$code" in 200) echo "CallQA: passed" ;; 412) echo "::error::CallQA: quality below threshold"; exit 1 ;; 202) echo "::error::CallQA: still running after 900 s"; exit 1 ;; *) echo "::error::CallQA API error $code"; exit 1 ;; esac