mirror of
https://github.com/ruvnet/RuView
synced 2026-07-25 17:51:48 +00:00
feat: vendor midstream and sublinear-time-solver libraries (#109)
Add ruvnet/midstream (AIMDS real-time inference) and ruvnet/sublinear-time-solver (sublinear optimization algorithms) as vendored dependencies under vendor/.
This commit is contained in:
+253
@@ -0,0 +1,253 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version to release (e.g., 1.0.0)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
jobs:
|
||||
# Create GitHub release
|
||||
create-release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
VERSION="${{ github.event.inputs.version }}"
|
||||
else
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
fi
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Version: $VERSION"
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
run: |
|
||||
# Install git-cliff if needed
|
||||
if ! command -v git-cliff &> /dev/null; then
|
||||
cargo install git-cliff
|
||||
fi
|
||||
|
||||
# Generate changelog
|
||||
git-cliff --latest --strip all > CHANGELOG.md
|
||||
|
||||
echo "Generated changelog:"
|
||||
cat CHANGELOG.md
|
||||
|
||||
- name: Create GitHub release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: v${{ steps.version.outputs.version }}
|
||||
release_name: Release v${{ steps.version.outputs.version }}
|
||||
body_path: CHANGELOG.md
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
# Build release binaries
|
||||
build-release:
|
||||
name: Build Release (${{ matrix.target }})
|
||||
needs: create-release
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
artifact_name: midstream-linux-x86_64
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
artifact_name: midstream-linux-aarch64
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
artifact_name: midstream-macos-x86_64
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
artifact_name: midstream-macos-aarch64
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
artifact_name: midstream-windows-x86_64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "release-${{ matrix.target }}"
|
||||
|
||||
- name: Install cross-compilation tools (Linux ARM)
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu
|
||||
|
||||
- name: Build release binary
|
||||
run: cargo build --release --target ${{ matrix.target }} --all-features
|
||||
|
||||
- name: Package binary (Unix)
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
cd target/${{ matrix.target }}/release
|
||||
tar czf ${{ matrix.artifact_name }}.tar.gz midstream
|
||||
mv ${{ matrix.artifact_name }}.tar.gz ../../../
|
||||
|
||||
- name: Package binary (Windows)
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
cd target/${{ matrix.target }}/release
|
||||
7z a ${{ matrix.artifact_name }}.zip midstream.exe
|
||||
move ${{ matrix.artifact_name }}.zip ../../../
|
||||
|
||||
- name: Upload release asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
asset_path: ./${{ matrix.artifact_name }}.${{ matrix.os == 'windows-latest' && 'zip' || 'tar.gz' }}
|
||||
asset_name: ${{ matrix.artifact_name }}.${{ matrix.os == 'windows-latest' && 'zip' || 'tar.gz' }}
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
# Publish crates to crates.io
|
||||
publish-crates:
|
||||
name: Publish to crates.io
|
||||
needs: create-release
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "publish"
|
||||
|
||||
- name: Update crate versions
|
||||
run: |
|
||||
VERSION="${{ needs.create-release.outputs.version }}"
|
||||
|
||||
# Update workspace crate versions
|
||||
for crate in temporal-compare nanosecond-scheduler temporal-attractor-studio temporal-neural-solver strange-loop; do
|
||||
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" crates/$crate/Cargo.toml
|
||||
done
|
||||
|
||||
# Update main crate version
|
||||
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
||||
|
||||
- name: Verify build after version update
|
||||
run: cargo build --workspace --all-features
|
||||
|
||||
- name: Publish crates in dependency order
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
run: |
|
||||
# Publish in order of dependencies
|
||||
cargo publish -p temporal-compare --allow-dirty
|
||||
sleep 10
|
||||
|
||||
cargo publish -p nanosecond-scheduler --allow-dirty
|
||||
sleep 10
|
||||
|
||||
cargo publish -p temporal-attractor-studio --allow-dirty
|
||||
sleep 10
|
||||
|
||||
cargo publish -p temporal-neural-solver --allow-dirty
|
||||
sleep 10
|
||||
|
||||
cargo publish -p strange-loop --allow-dirty
|
||||
sleep 10
|
||||
|
||||
# Finally publish main crate
|
||||
cargo publish --allow-dirty
|
||||
|
||||
# Update documentation
|
||||
update-docs:
|
||||
name: Update Documentation
|
||||
needs: [create-release, publish-crates]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "docs-release"
|
||||
|
||||
- name: Build documentation
|
||||
run: cargo doc --workspace --all-features --no-deps
|
||||
|
||||
- name: Add version badge to docs
|
||||
run: |
|
||||
VERSION="${{ needs.create-release.outputs.version }}"
|
||||
echo "<div style='padding: 1em; background: #4CAF50; color: white;'>Version: $VERSION</div>" \
|
||||
> target/doc/version.html
|
||||
|
||||
- name: Deploy documentation
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./target/doc
|
||||
destination_dir: docs/v${{ needs.create-release.outputs.version }}
|
||||
|
||||
- name: Update latest docs symlink
|
||||
run: |
|
||||
git checkout gh-pages
|
||||
ln -sfn v${{ needs.create-release.outputs.version }} docs/latest
|
||||
git add docs/latest
|
||||
git commit -m "Update latest docs to v${{ needs.create-release.outputs.version }}"
|
||||
git push
|
||||
|
||||
# Notify on completion
|
||||
release-complete:
|
||||
name: Release Complete
|
||||
needs: [create-release, build-release, publish-crates, update-docs]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
|
||||
steps:
|
||||
- name: Check release status
|
||||
run: |
|
||||
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
|
||||
echo "❌ Release process encountered errors"
|
||||
exit 1
|
||||
fi
|
||||
echo "✅ Release v${{ needs.create-release.outputs.version }} completed successfully!"
|
||||
echo "📦 Crates published to crates.io"
|
||||
echo "📚 Documentation updated"
|
||||
echo "🎉 Binaries available on GitHub Releases"
|
||||
+275
@@ -0,0 +1,275 @@
|
||||
name: Rust CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
jobs:
|
||||
# Code quality checks
|
||||
format:
|
||||
name: Format Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
clippy:
|
||||
name: Clippy Lints
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "clippy"
|
||||
|
||||
- name: Run clippy
|
||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
# Build and test matrix
|
||||
test:
|
||||
name: Test (${{ matrix.os }}, ${{ matrix.rust }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
rust: [stable, nightly]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "test-${{ matrix.os }}-${{ matrix.rust }}"
|
||||
|
||||
- name: Build workspace
|
||||
run: cargo build --workspace --all-features --verbose
|
||||
|
||||
- name: Run unit tests
|
||||
run: cargo test --workspace --all-features --lib --verbose
|
||||
|
||||
- name: Run integration tests
|
||||
run: cargo test --workspace --all-features --test '*' --verbose
|
||||
|
||||
- name: Run doc tests
|
||||
run: cargo test --workspace --all-features --doc --verbose
|
||||
|
||||
# Individual crate builds
|
||||
build-crates:
|
||||
name: Build Crates
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
crate:
|
||||
- temporal-compare
|
||||
- nanosecond-scheduler
|
||||
- temporal-attractor-studio
|
||||
- temporal-neural-solver
|
||||
- strange-loop
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "crate-${{ matrix.crate }}"
|
||||
|
||||
- name: Build ${{ matrix.crate }}
|
||||
run: cargo build -p ${{ matrix.crate }} --all-features --verbose
|
||||
|
||||
- name: Test ${{ matrix.crate }}
|
||||
run: cargo test -p ${{ matrix.crate }} --all-features --verbose
|
||||
|
||||
# WASM builds
|
||||
wasm:
|
||||
name: WASM Build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
crate:
|
||||
- temporal-compare
|
||||
- nanosecond-scheduler
|
||||
- strange-loop
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: wasm32-unknown-unknown
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "wasm"
|
||||
|
||||
- name: Install wasm-pack
|
||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
|
||||
- name: Build ${{ matrix.crate }} for WASM
|
||||
run: cargo build -p ${{ matrix.crate }} --target wasm32-unknown-unknown --no-default-features
|
||||
|
||||
# Benchmarks
|
||||
benchmark:
|
||||
name: Performance Benchmarks
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "bench"
|
||||
|
||||
- name: Run benchmarks
|
||||
run: cargo bench --workspace --all-features -- --output-format bencher | tee benchmark-results.txt
|
||||
|
||||
- name: Store benchmark results
|
||||
uses: benchmark-action/github-action-benchmark@v1
|
||||
if: github.event_name == 'push'
|
||||
with:
|
||||
tool: 'cargo'
|
||||
output-file-path: benchmark-results.txt
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
auto-push: true
|
||||
alert-threshold: '150%'
|
||||
comment-on-alert: true
|
||||
fail-on-alert: false
|
||||
|
||||
# Documentation
|
||||
docs:
|
||||
name: Documentation
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "docs"
|
||||
|
||||
- name: Build documentation
|
||||
run: cargo doc --workspace --all-features --no-deps
|
||||
env:
|
||||
RUSTDOCFLAGS: "-D warnings"
|
||||
|
||||
- name: Deploy documentation
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./target/doc
|
||||
destination_dir: docs
|
||||
|
||||
# Security audit
|
||||
security:
|
||||
name: Security Audit
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Install cargo-audit
|
||||
run: cargo install cargo-audit
|
||||
|
||||
- name: Run security audit
|
||||
run: cargo audit --deny warnings
|
||||
|
||||
# Code coverage
|
||||
coverage:
|
||||
name: Code Coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "coverage"
|
||||
|
||||
- name: Install cargo-tarpaulin
|
||||
run: cargo install cargo-tarpaulin
|
||||
|
||||
- name: Generate coverage
|
||||
run: cargo tarpaulin --workspace --all-features --out Xml --output-dir coverage
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./coverage/cobertura.xml
|
||||
fail_ci_if_error: false
|
||||
|
||||
# All checks passed
|
||||
ci-success:
|
||||
name: CI Success
|
||||
if: always()
|
||||
needs:
|
||||
- format
|
||||
- clippy
|
||||
- test
|
||||
- build-crates
|
||||
- wasm
|
||||
- docs
|
||||
- security
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check all jobs
|
||||
run: |
|
||||
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
|
||||
echo "One or more jobs failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "All CI jobs passed!"
|
||||
Reference in New Issue
Block a user