Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Full Test Suite

Full Test Suite #43

Workflow file for this run

name: Full Test Suite
on:
# Only run on PRs to main
pull_request:
branches: [main]
# Manual trigger for testing
workflow_dispatch:
# Nightly run to catch issues early
schedule:
- cron: '0 0 * * *' # Midnight UTC daily
# Run on version tags
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Full Test Suite
runs-on: ubuntu-latest
timeout-minutes: 30 # Fail if takes longer than 30 minutes
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
# Fast checks first
- name: Check formatting
run: cargo fmt --check
- name: Clippy with project rules
run: cargo clippy -- -D warnings
# Build with different feature combinations
- name: Build (default features)
run: cargo build --verbose
- name: Build (no default features)
run: cargo build --verbose --no-default-features
- name: Build (all features)
run: cargo build --verbose --all-features
# Run tests
- name: Run tests
run: cargo test --verbose
# Build release binary once for CLI tests
- name: Build release binary
run: cargo build --release
# Cache the binary path for subsequent steps
- name: Set binary path
run: echo "CODANNA_BIN=./target/release/codanna" >> $GITHUB_ENV
# Codanna-specific checks
- name: Check tree-sitter queries compile
run: |
# Ensure all tree-sitter queries are valid
cargo test --test "*" -- --nocapture | grep -i "query" || true
- name: Verify CLI commands
run: |
# Test basic CLI functionality using the built binary
$CODANNA_BIN --help
$CODANNA_BIN index --help
$CODANNA_BIN retrieve --help
# Performance checks
- name: Check binary size
run: |
ls -lh $CODANNA_BIN
size=$(stat -c%s $CODANNA_BIN 2>/dev/null || stat -f%z $CODANNA_BIN)
echo "Binary size: $size bytes"
if [ $size -gt 50000000 ]; then # 50MB limit
echo "::warning::Binary larger than 50MB"
fi
# Documentation
- name: Check docs build
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings