Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 86 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,116 @@ name: Utility-Protocol CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
test-and-lint:
rustfmt:
name: Rust formatting
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- name: Cache dependencies
components: rustfmt
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Check formatting
run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
run: cargo clippy --workspace --all-targets --all-features -- -D warnings

test:
name: Rust tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Run tests
run: cargo test
- name: Fuzz test detection
run: |
if [ -d "contracts/utility_contracts/fuzz" ]; then
cargo install cargo-fuzz || true
echo "✅ Fuzz testing infrastructure available"
else
echo "ℹ️ No fuzz tests found"
fi
run: cargo test --workspace --all-features

build-wasm:
needs: test-and-lint
wasm:
name: WASM build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache dependencies
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
- name: Build WASM artifact
run: cargo build --target wasm32-unknown-unknown --release
- name: Upload compiled artifacts
with:
shared-key: utility-protocol-ci
- name: Build WASM artifacts
run: cargo build --workspace --target wasm32-unknown-unknown --release
- name: Upload WASM artifacts
uses: actions/upload-artifact@v4
with:
name: wasm-artifacts
path: target/wasm32-unknown-unknown/release/*.wasm
path: target/wasm32-unknown-unknown/release/*.wasm
if-no-files-found: error

fuzz-detection:
name: Fuzz infrastructure detection
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Verify fuzz testing infrastructure
run: |
if [ -d "contracts/utility_contracts/fuzz" ]; then
cargo install cargo-fuzz --locked
cargo fuzz --version
echo "✅ Fuzz testing infrastructure available"
else
echo "ℹ️ No fuzz tests found"
fi
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ target
AGENTS.md
.agent/
agents/
issue.md
issue.md
node_modules/
Loading