| title | CI/CD Integration - Jarvy |
|---|---|
| description | Use Jarvy in CI/CD pipelines to ensure consistent tool versions across local development and CI environments. |
Jarvy works in CI pipelines the same way it works locally. Run jarvy setup in your CI job and every build gets the same tools your developers use.
Use the official setup-jarvy action:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Jarvy
uses: bearbinary/jarvy/.github/actions/setup-jarvy@main
with:
method: cargo # or "path" to build from workspace
- name: Provision tools
run: jarvy setup --ci
- name: Verify environment
run: jarvy doctor --format json| Input | Default | Description |
|---|---|---|
method |
cargo |
Install method: cargo (from crates.io) or path (build locally) |
version |
latest | Jarvy version to install |
path |
. |
Source path when method=path |
locked |
true |
Honor Cargo.lock |
stages:
- setup
- build
provision:
stage: setup
image: rust:latest
script:
- cargo install jarvy
- jarvy setup --ci
- jarvy doctorversion: 2.1
jobs:
build:
docker:
- image: cimg/rust:1.85
steps:
- checkout
- run:
name: Install Jarvy
command: cargo install jarvy
- run:
name: Provision tools
command: jarvy setup --citrigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
cargo install jarvy
displayName: Install Jarvy
- script: jarvy setup --ci
displayName: Provision tools
- script: jarvy --version
displayName: Show Jarvy versionJarvy can generate CI configuration files for you:
# Generate a GitHub Actions workflow
jarvy ci-config github
# Generate GitLab CI config
jarvy ci-config gitlab
# Preview without writing
jarvy ci-config circleci --dry-runSupported providers: github, gitlab, circleci, azure, bitbucket, travis, jenkins, buildkite, teamcity, appveyor.
When Jarvy detects a CI environment (CI=true), it automatically:
- Switches to non-interactive mode (no prompts)
- Disables telemetry
- Disables auto-update checks
- Skips services auto-start (unless
start_in_ci = true)
You can override these defaults:
# Force CI mode
jarvy setup --ci
# Force interactive mode in CI
jarvy setup --no-ciUse jarvy drift check as a CI gate to ensure environments match the config:
# GitHub Actions example
- name: Check for drift
run: jarvy drift check --format json
# Exit code 1 = drift detected, fails the job# Show detected CI environment
jarvy ci-infoOutput includes: provider name, build ID, branch, commit SHA, PR number (if applicable), and which environment variables were detected.