Health Check #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Health Check | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # Daily at 06:00 UTC | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| health-check: | |
| name: System Health Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: stable | |
| override: true | |
| components: rustfmt, clippy | |
| - name: Cache cargo registry | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-health-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Add WASM target | |
| run: rustup target add wasm32-unknown-unknown | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Check workspace compilation | |
| run: cargo check --workspace | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Run tests | |
| run: cargo test --workspace --exclude ipfs-metadata --exclude oracle --exclude escrow --exclude proxy --exclude security-audit --exclude compliance_registry || true | |
| - name: Check dependency versions | |
| run: | | |
| echo "ink! version:" | |
| grep 'ink.*version' Cargo.toml | head -1 | |
| echo "scale-codec version:" | |
| grep 'parity-scale-codec.*version' Cargo.toml | head -1 | |
| echo "scale-info version:" | |
| grep 'scale-info.*version' Cargo.toml | head -1 | |
| - name: Check contract health | |
| run: | | |
| cd contracts | |
| for dir in */; do | |
| if [ -f "$dir/Cargo.toml" ]; then | |
| echo "Checking contract: $dir" | |
| cd "$dir" | |
| cargo check 2>&1 || echo "WARN: $dir has issues" | |
| cd .. | |
| fi | |
| done |