Skip to main content
GitHub Actions is a powerful continuous integration and continuous delivery (CI/CD) platform that enables you to automate your software development workflows directly from your GitHub repository. It provides seamless integration with GitHub’s ecosystem, making it an ideal choice for teams looking to automate their API testing workflows. Bruno CLI integrates seamlessly with GitHub Actions to automate API testing workflows.
To follow along with the video, clone the Bruno Automation Demo Workspace and open it in Bruno.

Prerequisites

  • Git installed.
  • A GitHub repository containing a Bruno workspace.
  • Node.js (for installing the Bruno CLI).

Workspace Structure

The demo workspace is organized as a Bruno workspace with an OpenCollection layout:
Key items:
  • workspace.yml — defines the workspace and points to the collection at collections/bruno-automation-demo.
  • environments/ci.yml — a global environment with variables like bruno_echo_url, platform_name, and build_id used across all collections.
  • collections/bruno-automation-demo/ — the collection itself, containing folders of requests with tests and assertions.

Create the GitHub Actions Workflow

  1. In your repository, create the workflow directory:
  1. Create .github/workflows/bruno-api-tests.yml:

What this workflow does

Key bru run flags

  • --global-env ci — activates the ci global environment defined in environments/ci.yml at the workspace root.
  • --workspace-path ../.. — tells Bruno where the workspace root is relative to the collection directory. This is required when running bru run from inside a collection folder.
  • --tags smoke,workflow,release-gate — only runs requests tagged with these values.
  • --env-var — overrides environment variables at runtime, useful for injecting CI-specific values like the GitHub run ID and commit SHA.
  • --reporter-html — generates an HTML report of the test results.
For a full list of CLI options, see Command Options.

Run the Workflow

  1. Commit and push your workflow file:
  1. Monitor the workflow:
    • Go to your GitHub repository and click the Actions tab.
    • The workflow runs automatically on pushes and pull requests to main, or you can trigger it manually with workflow_dispatch.
  2. View the report:
    • Once the run completes, click into the workflow run.
    • Download the bruno-report artifact from the Artifacts section.
    • Open github-actions-report.html in your browser for a visual summary of all test results.

Learn More