skills/setup-ci/SKILL.md
Generate a GitHub Actions workflow that runs Grantiva VRT in CI on every pull request. Use to add cloud visual regression testing with GitHub Check integration to your project.
npx skillsauth add grantiva/swift-assist setup-ciInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a GitHub Actions workflow file that runs Grantiva's visual regression tests on every pull request, uploads results to the Grantiva cloud dashboard, and posts a GitHub Check directly on the PR.
/swift-assist:setup-ci
/swift-assist:setup-ci --output=.github/workflows/vrt.yml
--output=<path>: Where to write the workflow file (default: .github/workflows/grantiva-vrt.yml)grantiva.yml must exist with screen definitions (run /swift-assist:make-tests first)GRANTIVA_API_KEY secret setLoad project details from grantiva.yml:
cat grantiva.yml
Extract scheme, simulator, and bundle_id so the workflow targets the right build.
ls .github/workflows/
If a Grantiva workflow already exists, show the current file and ask whether to overwrite or update it.
Create .github/workflows/grantiva-vrt.yml (or the path from --output):
name: Visual Regression Tests
on:
pull_request:
branches: [main]
jobs:
vrt:
name: Grantiva VRT
runs-on: macos-15
environment: grantiva
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Grantiva CLI
run: brew install grantiva-io/tap/grantiva
- name: Run VRT
env:
GRANTIVA_API_KEY: ${{ secrets.GRANTIVA_API_KEY }}
run: grantiva ci run
- name: Upload diff artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: grantiva-diffs
path: .grantiva/diffs/
retention-days: 7
Tell the user what grantiva ci run does end-to-end:
grantiva.yml and captures a screenshot.grantiva/baselines/)The GitHub Check appears as "Grantiva VRT" in the PR checks list. If any screen exceeds the configured diff threshold, the check fails and blocks merge (if branch protection is enabled).
Print clear instructions for adding the API key:
To finish setup, add your Grantiva API key as a GitHub secret:
1. Go to https://github.com/<owner>/<repo>/settings/secrets/actions
2. Click "New repository secret"
3. Name: GRANTIVA_API_KEY
4. Value: your key from https://grantiva.io/settings/api-keys
Or use the GitHub CLI:
gh secret set GRANTIVA_API_KEY --body "grv_..."
Baselines are stored in .grantiva/baselines/ and committed to the repo. This means:
/swift-assist:vrt-approve, commit and push .grantiva/baselines/ so CI picks them up.grantiva/baselines/ to .gitignore - they need to be in source controlIf .gitignore currently excludes .grantiva/, print a warning and offer to fix it:
grep -n "\.grantiva" .gitignore
If found, suggest removing the line or scoping it to only exclude .grantiva/captures/ and .grantiva/diffs/.
CI workflow created.
File: .github/workflows/grantiva-vrt.yml
Trigger: pull_request -> main
Command: grantiva ci run
Secret: GRANTIVA_API_KEY (add to GitHub repo secrets)
Commit the workflow and baselines to activate:
git add .github/workflows/grantiva-vrt.yml .grantiva/baselines/
git commit -m "Add Grantiva VRT to CI"
git push
After pushing, open a PR and the Grantiva VRT check will appear automatically.
See results at: https://grantiva.io/dashboard
${{ secrets.GRANTIVA_API_KEY }}macos-15 or later for the runner - earlier versions may lack required simulator runtimes.grantiva/baselines/ is gitignored, warn the user - CI cannot run without committed baselinesgrantiva.yml - this skill only generates the workflow file--output, write to that path exactly (create intermediate directories if needed)testing
Run visual regression testing using Grantiva's diff pipeline. Capture screenshots, compare against baselines, and report visual differences. Use for catching unintended UI changes.
testing
Approve current VRT captures as new baselines. Can approve all or specific screens selectively. Use after reviewing /swift-assist:vrt results.
testing
Run generated test flows against the app in the simulator using Grantiva. Use after /swift-assist:make-tests to execute and validate your user flows.
development
Add the UI_TESTING / .mock services pattern to the app entry point so Grantiva can run tests with deterministic data and no live server. Use before make-tests when the app talks to an API.