Skip to content

Commit d7cb952

Browse files
committed
feat: add production-ready CI/CD, documentation, testing, and monitoring features
1 parent b5bd3bf commit d7cb952

File tree

153 files changed

+28597
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+28597
-300
lines changed

.cargo/config.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Use multiple CPU cores for compilation
44
jobs = 4
55

6-
# Enable incremental compilation
6+
# Enable incremental compilation for dev builds only
77
incremental = true
88

99
# Use faster linker on Unix systems
@@ -24,4 +24,8 @@ incremental = true
2424
[profile.clippy]
2525
inherits = "dev"
2626
opt-level = 0
27-
debug = false
27+
debug = false
28+
# sccache configuration for faster builds
29+
[env]
30+
RUSTC_WRAPPER = "sccache"
31+
SCCACHE_DIR = { value = "/tmp/sccache", force = true }

.github/workflows/release-consolidated.yml

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,15 @@ jobs:
8888
- **macOS (Apple Silicon)**: \`code-guardian-aarch64-apple-darwin.tar.gz\`
8989
- **Windows**: \`code-guardian-x86_64-pc-windows-msvc.zip\`
9090
91-
#### Using Cargo
92-
\`\`\`bash
93-
cargo install --git https://github.com/d-oit/code-guardian --tag $TAG
94-
\`\`\`
91+
#### Using Cargo (from crates.io)
92+
\`\`\`bash
93+
cargo install code-guardian-cli
94+
\`\`\`
95+
96+
#### Using Cargo (from source)
97+
\`\`\`bash
98+
cargo install --git https://github.com/d-oit/code-guardian --tag $TAG
99+
\`\`\`
95100
96101
### 🚀 Quick Start
97102
\`\`\`bash
@@ -242,10 +247,60 @@ jobs:
242247
env:
243248
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
244249

250+
# Publish crates to crates.io
251+
publish-crates:
252+
name: Publish to Crates.io
253+
needs: [create-release, build-release]
254+
runs-on: ubuntu-latest
255+
if: needs.create-release.result == 'success' && needs.create-release.outputs.is_prerelease == 'false'
256+
environment: release
257+
steps:
258+
- name: Checkout
259+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
260+
261+
- name: Setup Rust
262+
uses: ./.github/actions/setup-rust
263+
with:
264+
toolchain: stable
265+
266+
- name: Setup Cache
267+
uses: ./.github/actions/setup-cache
268+
with:
269+
cache-key-suffix: publish
270+
271+
- name: Publish code-guardian-core
272+
run: cargo publish --package code-guardian-core --allow-dirty
273+
env:
274+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
275+
276+
- name: Wait for core to propagate
277+
run: sleep 30
278+
279+
- name: Publish code-guardian-storage
280+
run: cargo publish --package code-guardian-storage --allow-dirty
281+
env:
282+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
283+
284+
- name: Wait for storage to propagate
285+
run: sleep 30
286+
287+
- name: Publish code-guardian-output
288+
run: cargo publish --package code-guardian-output --allow-dirty
289+
env:
290+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
291+
292+
- name: Wait for output to propagate
293+
run: sleep 30
294+
295+
- name: Publish code-guardian-cli
296+
run: cargo publish --package code-guardian-cli --allow-dirty
297+
env:
298+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
299+
245300
# Post-release tasks
246301
post-release:
247302
name: Post-Release Tasks
248-
needs: [create-release, build-release]
303+
needs: [create-release, build-release, publish-crates]
249304
runs-on: ubuntu-latest
250305
if: always() && needs.create-release.result == 'success'
251306
steps:
@@ -262,8 +317,14 @@ jobs:
262317
echo "" >> $GITHUB_STEP_SUMMARY
263318
echo "### Assets Built" >> $GITHUB_STEP_SUMMARY
264319
echo "- Linux (x86_64)" >> $GITHUB_STEP_SUMMARY
265-
echo "- Windows (x86_64)" >> $GITHUB_STEP_SUMMARY
320+
echo "- Windows (x86_64)" >> $GITHUB_STEP_SUMMARY
266321
echo "- macOS Intel (x86_64)" >> $GITHUB_STEP_SUMMARY
267322
echo "- macOS Apple Silicon (aarch64)" >> $GITHUB_STEP_SUMMARY
268323
echo "" >> $GITHUB_STEP_SUMMARY
324+
echo "### 📦 Crates Published" >> $GITHUB_STEP_SUMMARY
325+
echo "- [code-guardian-core](https://crates.io/crates/code-guardian-core)" >> $GITHUB_STEP_SUMMARY
326+
echo "- [code-guardian-storage](https://crates.io/crates/code-guardian-storage)" >> $GITHUB_STEP_SUMMARY
327+
echo "- [code-guardian-output](https://crates.io/crates/code-guardian-output)" >> $GITHUB_STEP_SUMMARY
328+
echo "- [code-guardian-cli](https://crates.io/crates/code-guardian-cli)" >> $GITHUB_STEP_SUMMARY
329+
echo "" >> $GITHUB_STEP_SUMMARY
269330
echo "🔗 [View Release](https://github.com/${{ github.repository }}/releases/tag/$TAG)" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ node_modules
3434
clippy_output.json
3535

3636
# Development workflow logs
37-
dev-workflow.log
37+
dev-workflow.log
38+
opencodetmp/opencode
39+
opencodetmp/opencode-linux-x64.zip
40+
sccache-*-musl/

.opencode/agent/agent-coordinator.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ tools:
3939
todowrite: true
4040
todoread: true
4141
bash: false
42-
task: true
4342
---
4443
## Overview
4544
The Agent Coordinator is an AI agent that orchestrates straightforward multi-agent workflows for complex tasks that can be decomposed into manageable subtasks. It manages basic handoffs between agents, leveraging existing @.opencode/agent agents or dynamically created ones, without advanced swarm intelligence features.

.opencode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "OpenCode plugin for Code Guardian, providing linting and testing best practices",
55
"type": "module",
66
"dependencies": {
7-
"@opencode-ai/plugin": "0.15.7"
7+
"@opencode-ai/plugin": "0.15.10"
88
},
99
"devDependencies": {
1010
"@babel/core": "^7.28.4",

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,45 @@ audit: ## Run security audit on dependencies
8989
@echo "🔒 Running security audit..."
9090
cargo audit
9191

92+
security-audit: ## Comprehensive security audit with cargo-deny
93+
@echo "🔒 Running comprehensive security audit..."
94+
cargo deny check
95+
96+
dependency-audit: ## Check for unused dependencies
97+
@echo "📦 Checking for unused dependencies..."
98+
cargo machete
99+
100+
modernize-tools: ## Install modern Rust tools (2024-2025 best practices)
101+
@echo "🔧 Installing modern Rust toolchain..."
102+
cargo install cargo-nextest cargo-deny cargo-machete mdbook cargo-chef sccache
103+
104+
setup-sccache: ## Configure sccache for distributed compilation
105+
@echo "⚡ Setting up sccache..."
106+
@mkdir -p ~/.cache/sccache
107+
@echo "SCCACHE_DIR=~/.cache/sccache" >> .env
108+
@echo "RUSTC_WRAPPER=sccache" >> .env
109+
@echo "✅ sccache configured. Use 'export RUSTC_WRAPPER=sccache' to enable"
110+
92111
# Documentation
93112
docs: ## Generate and open documentation
94113
@echo "📚 Generating documentation..."
95-
cargo doc --open --no-deps
114+
cargo doc --open
115+
116+
docs-serve: ## Serve documentation with mdbook
117+
@echo "📚 Starting documentation server..."
118+
@if command -v mdbook >/dev/null 2>&1; then \
119+
cd docs && mdbook serve --open; \
120+
else \
121+
echo "❌ mdbook not installed. Run 'make modernize-tools' first"; \
122+
fi
123+
124+
docs-build: ## Build documentation with mdbook
125+
@echo "📚 Building documentation..."
126+
@if command -v mdbook >/dev/null 2>&1; then \
127+
cd docs && mdbook build; \
128+
else \
129+
echo "❌ mdbook not installed. Run 'make modernize-tools' first"; \
130+
fi
96131

97132
docs-watch: ## Generate docs in watch mode
98133
@echo "👀 Watching documentation..."
@@ -152,6 +187,8 @@ ci-simulate: ## Simulate CI pipeline locally
152187
make test
153188
make coverage-ci
154189
make audit
190+
make security-audit
191+
make dependency-audit
155192

156193
# Performance profiling
157194
bench: ## Run benchmarks
@@ -245,7 +282,7 @@ fast-check: ## Quick development check (no expensive clippy)
245282
@echo "⚡ Fast quality check..."
246283
@cargo fmt --all -- --check
247284
@cargo check --workspace
248-
@cargo test --lib --workspace
285+
@cargo nextest run --lib --workspace
249286

250287
fast-lint: ## Fast clippy with reduced lints
251288
@echo "📎 Fast clippy..."

0 commit comments

Comments
 (0)