GitHub Action¶
Run Tomato tests in your CI/CD pipeline using the official GitHub Action.
Basic usage¶
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Tomato Tests
uses: tomatool/tomato@v2
Inputs¶
| Input | Description | Default |
|---|---|---|
version |
Tomato version (e.g., v1.0.0) |
Action's tag version |
config |
Config file path | tomato.yml |
features |
Feature files or directories | |
tags |
Filter by tags (e.g., @smoke and not @slow) |
|
scenario |
Filter by scenario name (regex) | |
verbose |
Show debug logs | false |
quiet |
Hide application logs | false |
skip-validate |
Skip configuration validation before running tests | false |
comment |
Post/update a test summary comment on the PR | true |
Examples¶
Filter by tags¶
Filter by scenario name¶
Run specific features¶
Verbose output¶
PR comment with test results¶
When enabled on a pull_request workflow, the action posts (or updates) a comment on the PR with a summary of test results — including pass/fail counts and failed scenario details.
Note: The
commentfeature requirespull-requests: writepermission. See the complete workflow example below.
Publish a JUnit report¶
Write a JUnit report from tomato.yml, then upload it or hand it to a test
reporter. File outputs are kept when comment is enabled.
- uses: tomatool/tomato@v2
- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: tomato-report
path: reports/
See Reports for all formats.
Pin to specific version¶
Try an unreleased commit¶
Used at a commit or a branch instead of a version tag, the action builds tomato from that same commit (with Go, which it sets up), so a change can run in your CI before it is released:
Setting version still installs that release instead.
Complete workflow example¶
name: Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Tomato Tests
uses: tomatool/tomato@v2
with:
config: 'tomato.yml'
verbose: 'true'
Requirements¶
- Docker must be available in the runner (default for
ubuntu-latest) - Repository must contain a valid
tomato.ymlconfiguration