Skip to content

Latest commit

 

History

History
151 lines (106 loc) · 3.32 KB

File metadata and controls

151 lines (106 loc) · 3.32 KB

CI/CD Guide

A.R.C. CLI uses GitHub Actions for continuous integration, security scanning, and releases.

Workflow Overview

Workflow Trigger Purpose Duration
ci.yml Push/PR Lint, test, build ~2 min
security.yml Push/PR, Weekly Security scans ~1 min
release.yml Tag push (v*) Production release ~5-10 min
feature-release.yml PR to develop Preview builds ~3-6 min

Development Workflow

Feature Development

# 1. Create feature branch
git checkout develop
git pull
git checkout -b feature/awesome-thing

# 2. Make changes
git add .
git commit -m "feat: add awesome thing"
git push origin feature/awesome-thing

# 3. Open PR to develop
# → CI runs (lint, test, build)
# → Security scans run
# → Preview build created

# 4. Merge to develop
# → Full CI with race detector

Release Process

# 1. Open PR: develop → main
# 2. Merge to main
# 3. Tag and push
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0

# → release.yml builds all platforms
# → Publishes release with binaries

Local Quality Checks

# Format code
make fmt

# Run linter (48 rules)
make lint

# Run tests
make test

# Full pre-commit check
make pre-commit

Branch Naming

Branch prefixes trigger auto-labeling:

Prefix Label
feature/, feat/ feature
fix/, bugfix/ bug
docs/ documentation
chore/ chore
perf/ performance
security/, sec/ security

Dependabot

Updates checked every Monday at 9 AM:

  • Patch updates: Auto-merged after CI passes
  • Minor updates: Manual review required
  • Major updates: Thorough review required

Charmbracelet libraries (UI) ignore major updates to prevent breaking changes.

Security Scanning

Every push/PR:

  • Gosec static analysis (high severity)
  • govulncheck for known vulnerabilities
  • Dependency review

Weekly scans:

  • Full security audit
  • Vulnerability database check

Performance Optimizations

Applied optimizations:

  • Go module caching (30-60s saved)
  • Merged test+coverage (no duplicates)
  • Conditional race detector (OFF for PRs, ON for main)

Results:

  • PR CI: 3-4 min → 1.5-2 min (60% faster)
  • GitHub Actions minutes: 50-60% reduction

Troubleshooting

CI Taking Too Long

  • Check if race detector is running (should be OFF for PRs)
  • Verify caching works (look for "Cache restored")
  • Consider test optimization

Linter Failures

# Run locally to see issues
make lint

# Auto-fix some issues
make fmt

Test Failures

# Run specific test
go test -v ./pkg/cli/... -run TestBanner

# Run with race detector
go test -race ./...

Configuration Files

File Purpose
.golangci.yml Linter rules (48 rules)
.github/release-drafter.yml Release notes template
.github/labeler.yml PR auto-labeling rules
.typos.toml Spell check config