ci cd pipelines
This document describes all GitHub Actions workflows configured for the PromptKit repository.
Overview
Section titled “Overview”PromptKit uses GitHub Actions for:
- Continuous Integration - Automated testing, linting, and quality checks
- Documentation Deployment - Automatic GitHub Pages updates
- Release Testing - Safe release workflow validation
Recent CI Optimizations (Nov 2025)
Section titled “Recent CI Optimizations (Nov 2025)”The CI pipeline has been optimized for efficiency and completeness:
- ✅ Eliminated duplicate test execution - Reduced from 3 test runs to 2 (normal + race detector)
- ✅ Complete module coverage - Now tests all modules including
pkg,tools/packc, andtools/inspect-state - ✅ Single test result publication - Coverage job now handles test reporting (removed duplicate from test job)
- ✅ Enhanced linting feedback - golangci-lint GitHub Action provides inline PR annotations
- ✅ Faster CI feedback - Reduced redundant overhead while maintaining thorough testing
These improvements ensure comprehensive testing across the entire monorepo while minimizing CI execution time.
Active Workflows
Section titled “Active Workflows”1. CI Pipeline (ci.yml)
Section titled “1. CI Pipeline (ci.yml)”Purpose: Run tests, coverage, linting, and builds on every code change.
Triggers:
- Push to
mainbranch (excluding docs and markdown files) - Pull requests to
mainbranch (excluding docs and markdown files)
Jobs:
Test Job
Section titled “Test Job”- Runs on: Ubuntu Latest
- Go Version: 1.25.1
- Steps:
- Checkout code
- Set up Go
- Install dependencies (
make install) - Install
gotestsumfor enhanced test reporting - Run tests (
make test) - Run tests with race detector (
make test-race)
Test Packages:
./runtime/...- Core runtime components./sdk/...- SDK library./pkg/...- Shared configuration and utilities./tools/arena/...- Arena CLI tool./tools/packc/...- PackC CLI tool./tools/inspect-state/...- State inspection utility
Note: This job runs tests twice (normal + race detector) for fast feedback. Test result publishing is handled by the Coverage job to avoid duplication.
Coverage Job
Section titled “Coverage Job”- Runs on: Ubuntu Latest
- Go Version: 1.25.1
- Steps:
- Checkout code (full depth for SonarCloud)
- Set up Go
- Install
gotestsum - Generate coverage reports with JUnit output for all modules
- Merge coverage files into single
coverage.out - Publish test results to GitHub Checks (single publication point)
- Verify coverage file
- Run SonarCloud scan
Coverage Packages:
./runtime/...- Core runtime components./sdk/...- SDK library./pkg/...- Shared configuration and utilities./tools/arena/...- Arena CLI tool./tools/packc/...- PackC CLI tool./tools/inspect-state/...- State inspection utility
SonarCloud Integration:
- Analyzes code quality, security, and coverage
- Results visible at: https://sonarcloud.io/project/overview?id=AltairaLabs_PromptKit
- Requires:
SONAR_TOKENsecret
Lint Job
Section titled “Lint Job”- Runs on: Ubuntu Latest
- Go Version: 1.25.1
- Steps:
- Checkout code
- Set up Go
- Run golangci-lint with GitHub Action
Linting Features:
- Inline PR annotations for issues
- Annotations in file diffs
- Results in PR checks tab
- Only shows new issues in PRs (
only-new-issues: true) - Comprehensive linting via
golangci-lint
Configuration: Uses .golangci.yml in repository root
Build Job
Section titled “Build Job”- Runs on: Ubuntu Latest
- Go Version: 1.25.1
- Steps:
- Checkout code
- Set up Go
- Build runtime components (
make build)
Permissions Required:
permissions: contents: read actions: read checks: write pull-requests: write2. Documentation Pipeline (docs.yml)
Section titled “2. Documentation Pipeline (docs.yml)”Purpose: Deploy documentation to GitHub Pages.
Triggers:
- Push to
mainbranch with changes to:docs/**directoryREADME.mdCONTRIBUTING.mdCODE_OF_CONDUCT.mdGOVERNANCE.mdSECURITY.md.github/workflows/docs.yml
- Manual trigger (
workflow_dispatch)
Jobs:
Build Job
Section titled “Build Job”- Runs on: Ubuntu Latest
- Ruby Version: 3.1
- Steps:
- Checkout code
- Setup Ruby with bundler cache
- Setup GitHub Pages
- Install Jekyll dependencies
- Build Jekyll site with production environment
- Upload site artifact
Jekyll Configuration:
- Source:
docs/directory - Output:
docs/_site/ - Environment: Production
- Base Path: Configured from GitHub Pages settings
Deploy Job
Section titled “Deploy Job”- Runs on: Ubuntu Latest
- Depends on: Build job
- Environment:
github-pages - Steps:
- Deploy artifact to GitHub Pages
Permissions Required:
permissions: contents: read pages: write id-token: writeConcurrency:
- Group:
pages - Cancel in progress:
false(ensures complete deployments)
Live Site: https://altairalabs.github.io/PromptKit
3. Release Test Pipeline (release-test.yml)
Section titled “3. Release Test Pipeline (release-test.yml)”Purpose: Safely test release preparation without creating actual releases.
Triggers:
- Manual dispatch (
workflow_dispatch) with inputs:tool: Choice of arena or packcversion: Test version (default: v0.0.1-test)
- Push to branches matching
release-test/** - Push to tags matching
test/tools/*/v*
Jobs:
Test Release Prep Job
Section titled “Test Release Prep Job”- Runs on: Ubuntu Latest
- Go Version: 1.25.1
- Steps:
- Checkout code (full depth)
- Setup Go
- Determine tool to test (from input or tag)
- Show current
go.modbefore changes - Simulate replace directive removal
- Show modified
go.mod - Attempt dependency resolution
- Show git diff of changes
- Test build with local dependencies
- Generate release checklist
- Upload checklist as artifact
Outputs:
- Release checklist markdown file
- Step-by-step release commands
- Validation of build process
Dry Run Summary Job
Section titled “Dry Run Summary Job”- Runs on: Ubuntu Latest
- Depends on: Test release prep job
- Steps:
- Output summary to GitHub Actions summary page
Testing Strategies:
- ✅ Test repo approach
- ✅ Test tags with prefix
- ✅ Test branches
Permissions Required:
permissions: contents: writeSecrets Required
Section titled “Secrets Required”The following secrets must be configured in GitHub repository settings:
| Secret | Purpose | Required For |
|---|---|---|
SONAR_TOKEN | SonarCloud authentication | CI Coverage job |
GITHUB_TOKEN | GitHub API access | Automatically provided by GitHub Actions |
Setting Secrets:
- Go to: Repository Settings → Secrets and variables → Actions
- Click “New repository secret”
- Add the secret name and value
Environment Configuration
Section titled “Environment Configuration”Go Version
Section titled “Go Version”All workflows use Go 1.25.1. Update in all workflow files when upgrading:
- name: Set up Go uses: actions/setup-go@v5 with: go-version: '1.25.1'Test Reporting
Section titled “Test Reporting”Test results are published to GitHub Checks using:
- Tool:
gotestsum - Format: JUnit XML
- Reporter:
dorny/test-reporter@v1.9.1
Code Quality
Section titled “Code Quality”SonarCloud integration provides:
- Coverage reports
- Code smells detection
- Security vulnerability scanning
- Technical debt analysis
Configuration: sonar-project.properties in root
Workflow Dependencies
Section titled “Workflow Dependencies”graph TD A[Push to main] --> B{Changed files?} B -->|Code changes| C[CI Pipeline] B -->|Doc changes| D[Docs Pipeline] C --> E[Test Job] C --> F[Coverage Job] C --> G[Lint Job] C --> H[Build Job] F --> I[SonarCloud] D --> J[Jekyll Build] J --> K[GitHub Pages Deploy]
L[Manual/Test Branch] --> M[Release Test Pipeline] M --> N[Validate Release Process]Adding a New Workflow
Section titled “Adding a New Workflow”To add a new GitHub Actions workflow:
- Create workflow file in
.github/workflows/ - Define trigger conditions
- Specify required permissions
- Define jobs and steps
- Test with a pull request
- Document in this file
Template:
name: My Workflow
on: push: branches: [ main ]
permissions: contents: read
jobs: my-job: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Do something run: echo "Hello"Debugging Failed Workflows
Section titled “Debugging Failed Workflows”Viewing Logs
Section titled “Viewing Logs”- Go to Actions tab in GitHub
- Click on the failed workflow run
- Click on the failed job
- Expand failed step to see logs
Common Issues
Section titled “Common Issues”Test Failures:
- Check test logs in the Test Results section
- Run tests locally:
make test-race - Check for race conditions
Coverage Issues:
- Verify coverage files exist:
ls -la *.out - Run locally:
make coverage - Check SonarCloud dashboard for details
Build Failures:
- Verify Go version matches locally:
go version - Check dependencies:
make install - Test build locally:
make build
Documentation Build Failures:
- Test Jekyll locally:
cd docs && bundle exec jekyll serve - Check Gemfile dependencies
- Verify markdown syntax
Release Test Failures:
- Review release checklist artifact
- Ensure dependencies would be published first
- Check go.mod for correct replace directives
Local Testing
Section titled “Local Testing”Before pushing changes, test locally:
# Run full CI suite locallymake testmake test-racemake lintmake buildmake coverage
# Build documentation locallycd docsbundle installbundle exec jekyll serve
# Test release process (dry run)./scripts/test-release.sh arena v0.0.1-testPipeline Metrics
Section titled “Pipeline Metrics”Monitor pipeline health:
- Build Success Rate: Target > 95%
- Average Duration: ~5-10 minutes for CI
- Coverage Threshold: Tracked by SonarCloud
- Documentation Deploy Time: ~2-3 minutes
View Metrics:
- GitHub Actions Insights tab
- SonarCloud dashboard
- Go Report Card: https://goreportcard.com/report/github.com/AltairaLabs/PromptKit
Maintenance Schedule
Section titled “Maintenance Schedule”Monthly
Section titled “Monthly”- Review and update Go version if needed
- Update GitHub Actions to latest versions
- Check for deprecated action warnings
Quarterly
Section titled “Quarterly”- Review SonarCloud quality gate rules
- Audit secrets and permissions
- Update Ruby version for docs build
Annually
Section titled “Annually”- Review and update all third-party actions
- Evaluate new testing/quality tools
- Document lessons learned
Related Documentation
Section titled “Related Documentation”- Testing Releases - Safe release testing
- Contributing Guide - Development workflow
- Makefile - Local build commands
- SonarCloud Configuration - Quality settings
Support
Section titled “Support”For CI/CD issues:
- Check GitHub Actions Status
- Review workflow logs
- Test locally with make commands
- Create issue with workflow run link
- Tag
@maintainersfor urgent issues
Last Updated: 2 November 2025