CI Integration
Boundary is designed for CI/CD pipelines. Use boundary check to get a pass/fail exit code based on your configured thresholds.
Exit Codes
| Code | Meaning |
|---|---|
0 | Pass – no violations at or above the failure threshold |
1 | Fail – violations found at or above the failure threshold |
GitHub Actions
name: Architecture Check
on:
pull_request:
branches: [main]
jobs:
boundary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Boundary
run: |
curl -fsSL https://github.com/rebelopsio/boundary/releases/latest/download/boundary-x86_64-unknown-linux-gnu.tar.gz \
| tar xz -C /usr/local/bin
- name: Check Architecture
run: boundary check . --format json --fail-on error
Configuration Options
Failure Threshold
Control which violation severity causes a non-zero exit:
# Fail on errors only (default)
boundary check . --fail-on error
# Fail on warnings and errors
boundary check . --fail-on warning
# Fail on everything including info
boundary check . --fail-on info
Or set it in .boundary.toml:
[rules]
fail_on = "error"
Minimum Score
Fail if the overall architecture score drops below a threshold:
[rules]
min_score = 70.0
JSON Output
Use --format json for machine-readable output that other tools can consume:
boundary check . --format json
Ignoring Rules
Suppress specific violations by rule ID using --ignore. This is useful for known false
positives or rules that don’t apply to certain projects:
# Ignore missing-port warnings (e.g. for DTOs and utilities)
boundary check . --ignore PA001
# Ignore multiple rules
boundary check . --ignore PA001,L005
Ignored violations are excluded before the pass/fail decision, so they won’t cause CI failures. See Rules & Rule IDs for the full rule catalog.
Evolution Tracking
Track architecture scores over time:
# Save a snapshot after each successful check
boundary check . --track
# Fail if the score regresses from the last snapshot
boundary check . --no-regression
Snapshots are stored in .boundary/ and can be committed to your repository to track trends.
GitLab CI
architecture:
stage: test
image: rust:latest
script:
- cargo install --git https://github.com/rebelopsio/boundary boundary
- boundary check . --format json --fail-on error
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
Pre-commit Hook
Run Boundary as a pre-commit check:
#!/bin/sh
# .git/hooks/pre-commit
boundary check . --fail-on error --compact