-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The current CI pipeline (build-cicd.yaml) builds Docker images and generates SBOMs but does not run any tests. PRs can be merged with failing tests, and there's no gate to prevent broken code from being deployed.
Current CI Pipeline
# Current workflow only does:
1. Checkout code
2. Setup Docker Buildx
3. Build Docker images (Ubuntu + Chainguard)
4. Generate SBOMs
5. Push to Docker HubProposed Changes
Add a test job that runs before the build job:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-action@stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run tests
run: cargo test --verbose
- name: Run tests (release mode)
run: cargo test --release --verbose
build:
needs: test # Only build if tests pass
runs-on: ubuntu-latest
# ... existing build stepsAcceptance Criteria
-
cargo testruns on every push and PR - Build job depends on test job (won't run if tests fail)
- Cargo registry/target cached for faster builds
- Test output visible in GitHub Actions logs
- Failed tests block PR merge (with branch protection)
- Both debug and release test configurations run
Additional Recommendations
Branch Protection Rules
After implementing this, enable branch protection on main:
- Require status checks to pass before merging
- Require "test" job to pass
- Require PR reviews (optional)
Test Matrix (Optional Enhancement)
strategy:
matrix:
rust: [stable, beta]
os: [ubuntu-latest, macos-latest]Minimum Rust Version Check
- name: Check MSRV
run: |
rustup install 1.77
cargo +1.77 checkImplementation
Update .github/workflows/build-cicd.yaml:
name: CI/CD
on:
push:
branches: ["*"]
pull_request:
branches: [main]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-action@stable
with:
components: rustfmt, clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --all-features --verbose
build:
name: Build and Push
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
# ... existing build configurationPriority
Critical - Without CI tests, there's no automated quality gate. Broken code can be merged and deployed.
Related Issues
- Add unit tests for LoadModel calculations #16 - Add unit tests for LoadModel (need tests to exist before CI runs them)
- Add unit tests for parse_duration_string() #17 - Add unit tests for parse_duration_string
- Add unit tests for configuration parsing and validation #18 - Add unit tests for configuration parsing
- Add integration tests with mock HTTP server #19 - Add integration tests
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request