minitest CLI with a workspace API key.
Find your app and scenario identifiers
Every setup below needs to say which app to test, and sometimes which scenarios.GitHub Actions
Install the Minitap GitHub App on your organization first (see GitHub), and give the job theid-token: write permission so the Action can sign in.
.github/workflows/minitap.yml
app-slug, Mini builds the app for iOS and Android from the commit the workflow runs on, using the app’s build settings, runs every scenario, and reports back through a GitHub check on the commit. The step returns as soon as the run is queued.
Upload a build you already made
If your workflow builds the app, pass the file and Mini tests that instead of building:.app or .ipa, and the Android build an .apk that runs on x86-64 emulators. Set run-ios: false or run-android: false to skip a platform. The Action reference has the build commands.
Gate a release on the verdict
Addwait-for-result: true and the step waits for the verdict. Add fail-on-failure: true and the step fails when the run fails, so every job that needs: it is skipped.
timeout-minutes above wait-timeout-minutes (45 by default), or GitHub stops the runner before the verdict arrives. The verdict lands in the result output: passed, failed, error, or nothing_affected when no scenario was affected and nothing ran, which passes the gate.
Run only what changed since the last release
On a release tag, Mini can run only the scenarios affected since the previous release instead of the whole suite. Set the Release tags pattern (a glob such asv* or release-v*) in Workbench → CI & Maintenance. From then on, a tag matching it runs the affected scenarios, and every other event runs the full suite. Set scope to choose yourself:
user-stories, or tag names in user-story-types (the input kept its old name; it takes tags). Either one overrides scope. See Choosing what to run for every option, and the Action reference for all inputs and outputs.
Any other CI, with the CLI
Every other CI runs the same three steps with the CLI: upload the build, start a run, wait for the verdict. The CLI’s exit code says whether a command worked, not whether your tests passed, so the job reads the verdict from the JSON output.1. Create an API key
In Settings → API keys, click Create API key and copy it: it’s shown once. Store it in your CI as a secret variable namedMINITEST_API_KEY, and set MINITEST_APP_ID to your app ID. See API keys.
2. Add the script
Commit this script asci/minitap.sh. It installs the CLI if needed, uploads the build you pass, runs every scenario on it and fails the job when a scenario has a critical failure. It needs bash, curl and jq on the runner.
ci/minitap.sh
- Fewer scenarios. Replace
run allwithrun start --tag smoketo run the scenarios carrying a tag, or withrun start "Sign in" "Checkout"for two or more scenarios by name or ID. - Both platforms. Upload both builds and pass
--ios-buildand--android-buildto the samerun all. - Web apps. Skip the upload and run
minitest --json run all --web, which tests the web targets set in the app’s settings. - Let Mini build the commit. For an app Mini builds from its repository,
minitest --json run from-commit <full-sha>builds that commit, runs the suite and waits for the verdict (one hour by default,--timeoutin seconds to change it). - Physical phones. Add
--ios-physicalor--android-physicaltorun allto use the real devices assigned to your workspace. An iOS device build is uploaded withbuild upload --physical; for Android, upload the.aab.
3. Call it from your pipeline
Each example assumes an earlier job producedbuild/app-release.aab; change the path to your build. Give the job a timeout a bit longer than the script’s 60 minutes.
- GitLab CI
- CircleCI
- Bitbucket Pipelines
- Azure Pipelines
- Jenkins
Add
MINITEST_API_KEY as a masked variable in Settings → CI/CD → Variables..gitlab-ci.yml
Exit codes
When aminitest command itself fails, its exit code says why:
Comments and checks on pull requests are GitHub only. On GitLab or Bitbucket, the pipeline job above is the gate. The full command list is in the CLI reference.
Next steps
GitHub Action reference
Every input and output, web runs and build requirements.
Pull request checks
A comment and a check on every GitHub pull request.
Read the run report
What each verdict means when the job goes red.
Upload a build
Which build files Mini accepts, per platform and device.
