Skip to main content
Automate your agent testing by integrating Cekura with GitHub Actions. This guide walks you through setting up workflows to test your agents automatically on every code change, pull request, or on a custom schedule. The Cekura GitHub Action is a simple, dependency-free solution that uses standard tools available on GitHub runners (curl, bash, and python3 for JSON parsing). No installation or setup required - it works out of the box.

Before You Get Started

Important: Before setting up a workflow, ensure your agent is properly configured with scenarios in the Cekura dashboard.
You’ll need your Agent ID and either Scenario IDs or Tags to select which tests to run.

Finding Your Agent ID

  1. Log in to your Cekura dashboard
  2. Navigate to the Agents section
  3. Select your agent
  4. Copy the Agent ID displayed in the agent details
You can retrieve your agent ID programmatically using the Cekura API:
curl --request GET \
  --url https://api.cekura.ai/test_framework/v1/aiagents/ \
  --header 'X-CEKURA-API-KEY: <api-key>'
The response will include your agent ID in the id field.

Using Tags vs Scenario IDs

You can run tests in two ways:

Using Scenario IDs

Run specific scenarios by their IDs. Use this when you want to test exact scenarios.
- uses: cekura-ai/[email protected]
  with:
    agent_id: ${{ vars.AGENT_ID }}
    scenario_ids: ${{ vars.SCENARIO_IDS }}
    api_key: ${{ secrets.CEKURA_API_KEY }}

Using Tags

Run all scenarios with specific tags. Use this when you want to test groups of scenarios (e.g., smoke-test, critical).
- uses: cekura-ai/[email protected]
  with:
    agent_id: ${{ vars.AGENT_ID }}
    tags: ${{ vars.TAGS }}
    api_key: ${{ secrets.CEKURA_API_KEY }}

Step-by-Step Tutorial

1

Create Workflow File

In your repository, create a file at .github/workflows/test-agents.yml:
name: Agent Tests

on:
  workflow_dispatch:
    inputs:
      agent_id:
        description: 'The agent identifier'
        required: false
        type: string
      scenario_ids:
        description: 'Comma-separated scenario IDs (e.g., "123,456,789")'
        required: false
        type: string
      api_url:
        description: 'Custom Cekura API endpoint'
        required: false
        type: string
        default: 'https://api.cekura.ai'

  push:
    branches: [main]
  pull_request:
    types: [opened, synchronize]

jobs:
  run-simulation-tests:
    runs-on: ubuntu-latest
    steps:
      - name: Cekura Run Tests
        uses: cekura-ai/[email protected]
        with:
          agent_id: ${{ inputs.agent_id || vars.AGENT_ID }}
          scenario_ids: ${{ inputs.scenario_ids || vars.SCENARIO_IDS }}
          api_url: ${{ inputs.api_url || vars.API_URL }}
          api_key: ${{ secrets.CEKURA_API_KEY }}
2

Configure Variables & Secrets

Go to your repository → SettingsSecrets and variablesActionsAdd Secret (API Key):
  1. Click New repository secret
  2. Name: CEKURA_API_KEY
  3. Value: Your API key from the Cekura dashboard
Add Variables:
  1. Click the Variables tab
  2. Click New repository variable
  3. Add required variables:
    • AGENT_ID - Your agent ID (required)
  4. Add one or both of the following:
    • SCENARIO_IDS - Comma-separated scenario IDs (e.g., 123,456,789)
    • TAGS - Comma-separated tags (e.g., smoke-test,critical)
  5. Optionally add:
    • PHONE_NUMBER - Outbound phone number for testing (e.g., +1234567890)
Add GitHub Variables
3

Start Test Run

To test your workflow, make a change to your codebase and raise a pull request. This will trigger the workflow automatically.Workflow Triggered
4

Monitor Workflow

  1. Go to your repository on GitHub
  2. Click the Actions tab
  3. You’ll see your workflow running
  4. Click on the workflow run to see detailed logs
Workflow Running

Advanced Usage

Different Triggers

on:
  push:
    branches: [main]
on:
  pull_request:
    types: [opened, synchronize]
on:
  workflow_dispatch:
Then trigger from the Actions tab → Run workflow button.
For more information about workflow triggers and events, check out the GitHub Actions official documentation.

Environment-Specific Testing

Test different environments (staging, production) with separate secrets:
jobs:
  staging-tests:
    runs-on: ubuntu-latest
    steps:
      - name: Test Staging
        uses: cekura-ai/[email protected]
        with:
          agent_id: ${{ vars.STAGING_AGENT_ID }}
          tags: ${{ vars.STAGING_TAGS }}
          api_url: 'https://api.cekura.ai'
          api_key: ${{ secrets.STAGING_API_KEY }}

  production-tests:
    runs-on: ubuntu-latest
    needs: staging-tests
    steps:
      - name: Test Production
        uses: cekura-ai/[email protected]
        with:
          agent_id: ${{ vars.PROD_AGENT_ID }}
          tags: ${{ vars.PROD_TAGS }}
          api_key: ${{ secrets.PROD_API_KEY }}

Testing with Phone Numbers

When testing agents that make outbound calls, you can specify a phone number:
jobs:
  run-simulation-tests:
    runs-on: ubuntu-latest
    steps:
      - name: Run Cekura Tests
        uses: cekura-ai/[email protected]
        with:
          agent_id: ${{ vars.AGENT_ID }}
          scenario_ids: ${{ vars.SCENARIO_IDS }}
          phone_number: ${{ vars.PHONE_NUMBER }}
          api_key: ${{ secrets.CEKURA_API_KEY }}

Action Inputs

The action accepts these inputs:
InputDescriptionRequiredDefault
agent_idAgent ID to testYes-
api_keyCekura API KeyYes-
scenario_idsComma-separated scenario IDs (e.g., 123,456,789)No*-
tagsComma-separated tags (e.g., smoke-test,critical)No*-
phone_numberOutbound phone number for testingNo-
api_urlCekura API URLNohttps://api.cekura.ai
frequencyRun each scenario N timesNo1
timeoutTimeout in secondsNo3600
*Either scenario_ids or tags must be provided (or both)

Example with All Options

jobs:
  run-simulation-tests:
    runs-on: ubuntu-latest
    steps:
      - name: Run Cekura Tests
        uses: cekura-ai/[email protected]
        with:
          agent_id: ${{ vars.AGENT_ID }}
          scenario_ids: ${{ vars.SCENARIO_IDS }}
          tags: ${{ vars.TAGS }}
          phone_number: ${{ vars.PHONE_NUMBER }}
          api_url: 'https://api.cekura.ai'
          frequency: '3'      # Run each scenario 3 times
          timeout: '7200'     # 2 hour timeout
          api_key: ${{ secrets.CEKURA_API_KEY }}

Troubleshooting

Make sure your workflow file is:
  • Located in .github/workflows/ directory
  • Pushed to your repository (workflows don’t run from local files)
  • Named with .yml or .yaml extension
Common secret issues:
  • Secret names are case-sensitive - must match exactly
  • Secrets must be added in Settings → Secrets and variables → Actions
  • Forked repos can’t access secrets from the parent repository
Check these in your workflow logs:
  • API key is valid and has correct permissions
  • Agent ID and Scenario IDs are correct
  • Scenario IDs format: comma-separated with no spaces (e.g., 123,456,789)
  • Try increasing timeout with timeout: '7200' parameter
Make sure you’re using Variables (not Secrets) for Agent ID and Scenario IDs:
  • Go to Settings → Secrets and variables → Actions → Variables tab
  • Variables are referenced with vars.VARIABLE_NAME
  • Secrets are referenced with secrets.SECRET_NAME