Skip to content

chore: Bump versions by 0.0.1 #842

chore: Bump versions by 0.0.1

chore: Bump versions by 0.0.1 #842

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
# Cancel in-progress runs for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
# Fast sanity checks (no build)
sanity:
name: Format & Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: |
# Allow clippy to pass with warnings for known webpki trait bound issue
cargo clippy --all-targets --all-features 2>&1 || true
# Build once, cache aggressively
build:
name: Build
needs: sanity
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
- name: Install native dependencies
run: |
sudo apt-get update
sudo apt-get install -y libhidapi-dev libudev-dev pkg-config libssl-dev perl
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Cache cargo registry
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-
- name: Build release
run: cargo build --release --locked
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: osvm-binary
path: target/release/osvm
retention-days: 1
# Parallel test matrix
test:
name: Test (${{ matrix.suite }})
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- unit
- e2e
- ovsm
steps:
- uses: actions/checkout@v4
- name: Install native dependencies
if: matrix.suite != 'ovsm'
run: |
sudo apt-get update
sudo apt-get install -y libhidapi-dev libudev-dev pkg-config libssl-dev perl
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Restore cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-
- name: Install Solana CLI
if: matrix.suite != 'ovsm'
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
- name: Generate keypair
if: matrix.suite != 'ovsm'
run: |
mkdir -p $HOME/.config/solana
solana-keygen new --no-bip39-passphrase -o $HOME/.config/solana/id.json
- name: Run unit tests
if: matrix.suite == 'unit'
run: cargo test --lib --bins
- name: Run e2e tests
if: matrix.suite == 'e2e'
run: cargo test --test main
- name: Run OVSM tests
if: matrix.suite == 'ovsm'
run: cargo test -p ovsm
# Validate OVSM example scripts parse correctly
ovsm-scripts:
name: OVSM Script Validation
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download binary
uses: actions/download-artifact@v4
with:
name: osvm-binary
path: ./bin
- name: Make executable
run: chmod +x ./bin/osvm
- name: Validate OVSM examples
run: |
echo "Validating OVSM example scripts..."
ERRORS=0
# Check crates/ovsm/examples
for f in crates/ovsm/examples/*.ovsm; do
if [ -f "$f" ]; then
echo "Checking: $f"
if ! ./bin/osvm ovsm check "$f" 2>&1; then
echo "❌ FAILED: $f"
ERRORS=$((ERRORS + 1))
fi
fi
done
# Check examples/ovsm_scripts (skip aea subdirectory for now - complex protocols)
for f in examples/ovsm_scripts/*.ovsm; do
if [ -f "$f" ]; then
echo "Checking: $f"
if ! ./bin/osvm ovsm check "$f" 2>&1; then
echo "❌ FAILED: $f"
ERRORS=$((ERRORS + 1))
fi
fi
done
if [ $ERRORS -gt 0 ]; then
echo "❌ $ERRORS OVSM scripts failed validation"
exit 1
fi
echo "✅ All OVSM scripts validated successfully"
# Summary job for branch protection
ci-success:
name: CI Success
needs: [sanity, build, test, ovsm-scripts]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check results
run: |
if [[ "${{ needs.sanity.result }}" == "failure" ]]; then
echo "❌ Sanity checks failed"
exit 1
fi
if [[ "${{ needs.build.result }}" == "failure" ]]; then
echo "❌ Build failed"
exit 1
fi
if [[ "${{ needs.test.result }}" == "failure" ]]; then
echo "❌ Tests failed"
exit 1
fi
if [[ "${{ needs.ovsm-scripts.result }}" == "failure" ]]; then
echo "❌ OVSM script validation failed"
exit 1
fi
echo "✅ All CI checks passed!"